Perform ECDH key agreement followed by HKDF key derivation. Returns opaque symmetric key suitable for symmetric encryption.
Opaque EC private key
Opaque EC public key of other party
Parameters for HKDF derivation
Opaque symmetric key
Compute hash digest.
Hash algorithm to use (SHA-256, SHA-384, SHA-512)
Data to hash
Encrypt content with the default or handed algorithm. Accepts Binary or SymmetricKey as payload (for key wrapping with symmetric keys).
Encrypt with asymmetric public key (RSA-OAEP). Accepts Binary or SymmetricKey for key wrapping.
OptionalexportOPTIONAL -- ONLY USE FOR TESTING/DEVELOPMENT. Private keys should NOT be exportable in secure environments. Export an opaque private key to PEM format.
Opaque private key
PEM-encoded private key (PKCS8 format)
Export an opaque public key to JWK format.
Opaque public key
JWK representation
Export an opaque public key to PEM format.
Opaque public key
PEM-encoded public key (SPKI format)
Extract PEM public key from X.509 certificate or return PEM key as-is.
Used to normalize KAS public keys which may be provided as either:
For certificates, jwaAlgorithm must be provided to correctly parse the key (e.g., 'RS256', 'RS512', 'ES256', 'ES384', 'ES512'). For raw PEM keys, the algorithm parameter is ignored.
PEM-encoded public key or X.509 certificate
OptionaljwaAlgorithm: stringJWA algorithm for certificate parsing (required for certificates)
PEM-encoded public key (SPKI format)
Generate an EC key pair for ECDH key agreement.
Optionalcurve: ECCurveElliptic curve to use (defaults to P-256)
Generate symmetric AES key (opaque, never hex string).
Generate an RSA key pair for encryption/decryption.
Optionalsize: numberin bits, defaults to a reasonable size for the default method
Opaque key pair
Generate an RSA key pair for signing/verification.
Opaque key pair
Compute HMAC-SHA256 of data with a symmetric key.
Data to authenticate
Opaque symmetric key
Raw HMAC bytes
OptionalimportImport a PEM private key as an opaque key. Optional - intended for use in tests or by downstream integrators who need to bring their own PEM key material. Main SDK code should use opaque PrivateKey objects directly.
PEM-encoded private key
Import options (usage required for RSA keys to disambiguate encrypt vs sign)
Opaque private key with metadata
Import a PEM public key as an opaque key.
PEM-encoded public key
Import options (usage required for RSA keys to disambiguate encrypt vs sign)
Opaque public key with metadata
Import raw key bytes as an opaque symmetric key. Used for external keys (e.g., unwrapped from KAS).
Raw key bytes
Opaque symmetric key
Convert a JWK (JSON Web Key) public key to PEM format. Supports both RSA and EC keys.
JSON Web Key object
PEM-encoded public key
Merge symmetric key shares back into the original key using XOR.
Array of key shares (from splitSymmetricKey)
Merged symmetric key
Default algorithm identifier.
Track which crypto implementation we are using
Parse and validate a PEM public key, returning algorithm info.
PEM-encoded public key or X.509 certificate
Validated PEM and detected algorithm
Sign data with an asymmetric private key.
Data to sign
Opaque private key
Signing algorithm (RS256, ES256, ES384, ES512)
Split a symmetric key into N shares using XOR secret sharing.
DefaultCryptoService: Uses keySplit() utility (extracts bytes internally) HSM implementations: Must use native splitting OR throw ConfigurationError
Symmetric key to split
Number of shares to create
Array of opaque key shares
Verify signature with an asymmetric public key.
Original data that was signed
Signature to verify
Opaque public key
Must match algorithm used for signing
Verify HMAC-SHA256.
Original data that was authenticated
HMAC to verify
Opaque symmetric key
Try to decrypt content with the default or handed algorithm. Throws on most failure, if auth tagging is implemented for example.