Interface Key

All Superinterfaces:
HasId, HasInnerModel<KeyProperties>, HasName, Indexable, Updatable<Key.Update>

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

    • getJsonWebKey

      JsonWebKey getJsonWebKey()
      Gets the Json web key.
      Returns:
      the Json web key.
    • getJsonWebKeyAsync

      Mono<JsonWebKey> getJsonWebKeyAsync()
      Gets the Json web key.
      Returns:
      the Json web key.
    • attributes

      KeyProperties attributes()
      Gets the key management attributes.
      Returns:
      the key management attributes.
    • tags

      Map<String,String> tags()
      Gets application specific metadata in the form of key-value pairs.
      Returns:
      application specific metadata in the form of key-value pairs.
    • managed

      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.
    • listVersions

      com.azure.core.http.rest.PagedIterable<Key> 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

      com.azure.core.http.rest.PagedFlux<Key> 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
    • backup

      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

      Mono<byte[]> 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
    • encrypt

      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

      Mono<byte[]> 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
    • decrypt

      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

      Mono<byte[]> 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
    • sign

      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

      Mono<byte[]> 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
    • verify

      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

      Mono<Boolean> 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

      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

      Mono<byte[]> 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
    • unwrapKey

      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

      Mono<byte[]> 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