Sdílet prostřednictvím


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()

Gets the key management attributes.

abstract byte[] backup()

GEts a backup of the specified key be downloaded to the client.

abstract Mono<byte[]> backupAsync()

Gets a backup of the specified key be downloaded to the client.

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()

Gets the Json web key.

abstract Mono<JsonWebKey> getJsonWebKeyAsync()

Gets the Json web key.

abstract PagedIterable<Key> listVersions()

Gets a list of individual key versions with the same key name.

abstract PagedFlux<Key> listVersionsAsync()

Gets a list of individual key versions with the same key name.

abstract boolean managed()

Checks whether the key's lifetime is managed by key vault.

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()

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

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()

Gets the key management attributes.

Returns:

the key management attributes.

backup

public abstract byte[] backup()

GEts a backup of the specified key be downloaded to the client.

Returns:

a backup of the specified key be downloaded to the client

backupAsync

public abstract Mono backupAsync()

Gets a backup of the specified key be downloaded to the client.

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()

Gets the Json web key.

Returns:

the Json web key.

getJsonWebKeyAsync

public abstract Mono getJsonWebKeyAsync()

Gets the Json web key.

Returns:

the Json web key.

listVersions

public abstract PagedIterable listVersions()

Gets a list of individual key versions with the same key name.

Returns:

a list of individual key versions with the same key name

listVersionsAsync

public abstract PagedFlux listVersionsAsync()

Gets a list of individual key versions with the same key name.

Returns:

a list of individual key versions with the same key name

managed

public abstract boolean managed()

Checks whether the key's lifetime is managed by key vault.

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()

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

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