Key Interface

Implements

public interface Key
extends Indexable, HasInnerModel<KeyProperties>, HasId, HasName, Updatable<Update>

An immutable client-side representation of an Azure Key Vault key.

Method Summary

Modifier and Type Method and Description
abstract KeyProperties attributes()
abstract byte[] backup()
abstract Mono<byte[]> backupAsync()
abstract byte[] decrypt(EncryptionAlgorithm algorithm, byte[] content)

Decrypts a single block of encrypted data.

abstract Mono<byte[]> decryptAsync(EncryptionAlgorithm algorithm, byte[] content)

Decrypts a single block of encrypted data.

abstract byte[] encrypt(EncryptionAlgorithm algorithm, byte[] content)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

abstract Mono<byte[]> encryptAsync(EncryptionAlgorithm algorithm, byte[] content)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

abstract JsonWebKey getJsonWebKey()
abstract Mono<JsonWebKey> getJsonWebKeyAsync()
abstract PagedIterable<Key> listVersions()
abstract PagedFlux<Key> listVersionsAsync()
abstract boolean managed()
abstract byte[] sign(SignatureAlgorithm algorithm, byte[] digest)

Creates a signature from a digest.

abstract Mono<byte[]> signAsync(SignatureAlgorithm algorithm, byte[] digest)

Creates a signature from a digest.

abstract Map<String,String> tags()
abstract byte[] unwrapKey(KeyWrapAlgorithm algorithm, byte[] key)

Unwraps a symmetric key wrapped originally by this Key Vault key.

abstract Mono<byte[]> unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key)

Unwraps a symmetric key wrapped originally by this Key Vault key.

abstract boolean verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature)

Verifies a signature from a digest.

abstract Mono<Boolean> verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature)

Verifies a signature from a digest.

abstract byte[] wrapKey(KeyWrapAlgorithm algorithm, byte[] key)

Wraps a symmetric key using the specified algorithm.

abstract Mono<byte[]> wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key)

Wraps a symmetric key using the specified algorithm.

Method Details

attributes

public abstract KeyProperties attributes()

Returns:

the key management attributes.

backup

public abstract byte[] backup()

Returns:

a backup of the specified key be downloaded to the client

backupAsync

public abstract Mono backupAsync()

Returns:

a backup of the specified key be downloaded to the client

decrypt

public abstract byte[] decrypt(EncryptionAlgorithm algorithm, byte[] content)

Decrypts a single block of encrypted data.

Parameters:

algorithm - the JWK encryption algorithm
content - the content to be decrypted

Returns:

the decrypted value

decryptAsync

public abstract Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] content)

Decrypts a single block of encrypted data.

Parameters:

algorithm - the JWK encryption algorithm
content - the content to be decrypted

Returns:

the decrypted value

encrypt

public abstract byte[] encrypt(EncryptionAlgorithm algorithm, byte[] content)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

Parameters:

algorithm - the JWK encryption algorithm
content - the content to be encrypted

Returns:

the encrypted value

encryptAsync

public abstract Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] content)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

Parameters:

algorithm - the JWK encryption algorithm
content - the content to be encrypted

Returns:

the encrypted value

getJsonWebKey

public abstract JsonWebKey getJsonWebKey()

Returns:

the Json web key.

getJsonWebKeyAsync

public abstract Mono getJsonWebKeyAsync()

Returns:

the Json web key.

listVersions

public abstract PagedIterable listVersions()

Returns:

a list of individual key versions with the same key name

listVersionsAsync

public abstract PagedFlux listVersionsAsync()

Returns:

a list of individual key versions with the same key name

managed

public abstract boolean managed()

Returns:

true if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true.

sign

public abstract byte[] sign(SignatureAlgorithm algorithm, byte[] digest)

Creates a signature from a digest.

Parameters:

algorithm - the JWK signing algorithm
digest - the content to be signed

Returns:

the signature in a byte array

signAsync

public abstract Mono signAsync(SignatureAlgorithm algorithm, byte[] digest)

Creates a signature from a digest.

Parameters:

algorithm - the JWK signing algorithm
digest - the content to be signed

Returns:

the signature in a byte array

tags

public abstract Map tags()

Returns:

application specific metadata in the form of key-value pairs.

unwrapKey

public abstract byte[] unwrapKey(KeyWrapAlgorithm algorithm, byte[] key)

Unwraps a symmetric key wrapped originally by this Key Vault key.

Parameters:

algorithm - the JWK encryption algorithm
key - the key to unwrap

Returns:

the unwrapped symmetric key

unwrapKeyAsync

public abstract Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key)

Unwraps a symmetric key wrapped originally by this Key Vault key.

Parameters:

algorithm - the JWK encryption algorithm
key - the key to unwrap

Returns:

the unwrapped symmetric key

verify

public abstract boolean verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature)

Verifies a signature from a digest.

Parameters:

algorithm - the JWK signing algorithm
digest - the content to be signed
signature - the signature to verify

Returns:

true if the signature is valid

verifyAsync

public abstract Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature)

Verifies a signature from a digest.

Parameters:

algorithm - the JWK signing algorithm
digest - the content to be signed
signature - the signature to verify

Returns:

true if the signature is valid

wrapKey

public abstract byte[] wrapKey(KeyWrapAlgorithm algorithm, byte[] key)

Wraps a symmetric key using the specified algorithm.

Parameters:

algorithm - the JWK encryption algorithm
key - the symmetric key to wrap

Returns:

the wrapped key

wrapKeyAsync

public abstract Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key)

Wraps a symmetric key using the specified algorithm.

Parameters:

algorithm - the JWK encryption algorithm
key - the symmetric key to wrap

Returns:

the wrapped key

Applies to