Generate a public key
POST
/end-to-end-keys
import { SDK } from "openapi";
const sdk = new SDK({
xMoovVersion: "v2024.01.00",
});
async function run() {
const result = await sdk.endToEndEncryption.generateKey();
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use OpenAPI\OpenAPI;
$sdk = OpenAPI\SDK::builder()
->setXMoovVersion('v2024.01.00')
->build();
$response = $sdk->endToEndEncryption->generateKey(
);
if ($response->jsonWebKey !== null) {
// handle response
}from openapi import SDK
with SDK(
x_moov_version="v2024.01.00",
) as sdk:
res = sdk.end_to_end_encryption.generate_key()
# Handle response
print(res)package hello.world;
import java.lang.Exception;
import org.openapis.openapi.SDK;
import org.openapis.openapi.models.operations.GenerateEndToEndKeyResponse;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.xMoovVersion("v2024.01.00")
.build();
GenerateEndToEndKeyResponse res = sdk.endToEndEncryption().generateKey()
.call();
if (res.jsonWebKey().isPresent()) {
// handle response
}
}
}require 'openapi'
Models = ::OpenApiSDK::Models
s = ::OpenApiSDK::SDK.new(
x_moov_version: 'v2024.01.00',
)
res = s.end_to_end_encryption.generate_key()
unless res.json_web_key.nil?
# handle response
endThe request completed successfully.
{
"alg": "ECDH-ES+A256KW",
"crv": "P-521",
"kid": "bOaoOIgm-7dI_gBIvsr0jQrPyYp6H_od0Ok-hSYZQ-g=",
"kty": "EC",
"use": "enc",
"x": "ABcm3wzKpPzYYwjDC0HSrxxVM3ULbuMDUuzkR5wNciaMHkZvQ02gLFdqTL65evV7EWaQyC7zRc28eW20p5MVDdQr",
"y": "AVa-eQsoiltOcQYy1QEcrQ9NbWktl_D4ewfg8diOZ2_svLEgEu4T1PqNcLbBGozP_VqPkXOMwNCUNI7pxajVGiIP"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Request was refused due to rate limiting.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Headers
X-Moov-Version
string
Specify an API version.
API versioning follows the format vYYYY.QQ.BB, where
YYYYis the yearQQis the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)BBis the build number, starting at.01, for subsequent builds in the same quarter.- For example,
v2024.01.00is the initial release of the first quarter of 2024.
- For example,
The dev version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
When no version is specified, the API defaults to v2024.01.00.
Response
kty
string
required
The cryptographic algorithm family used with the key (e.g., 'RSA', 'EC', 'oct').
alg
string
The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
crv
string
The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.
This field is required when kty is 'EC'.
e
string
The exponent value for RSA keys.
This field is required when kty is 'RSA'.
key_ops
array<string>
The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
kid
string
A unique identifier for the key.
n
string
The modulus value for RSA keys.
This field is required when kty is 'RSA'.
use
string<enum>
The intended use of the key. 'sig' for signature, 'enc' for encryption.
Possible values:
sig,
enc
x
string
The x coordinate for Elliptic Curve keys.
This field is required when kty is 'EC'.
y
string
The y coordinate for Elliptic Curve keys.
This field is required when kty is 'EC'.