public enum KeyUsage

  1. Object
  2. Enum<KeyUsage>
  3. KeyUsage

ImplementsComparable<KeyUsage>

What a KeyHandle is allowed to do.

Usages are fixed when a handle is created and are not widened afterwards. A handle created to seal records cannot be talked into signing, which matters because the two operations under one key is a classic way to turn a confidentiality primitive into an oracle. Web Crypto enforces the same restriction on a CryptoKey, and this mirrors it so a port cannot be more permissive than the browser is.

Enum constants

SEALAuthenticated encryption: KeyHandle.seal.
OPENAuthenticated decryption: KeyHandle.open.
MACMessage authentication: KeyHandle.mac.
VERIFY_MACVerification of a tag produced by MAC.
WRAPWrapping another key.
UNWRAPUnwrapping a key wrapped under WRAP.

Methods

public static KeyUsage[] values()
public static KeyUsage valueOf(String name)

Inherited methods

Enum constant details

SEAL

SEAL
Authenticated encryption: KeyHandle.seal.

OPEN

OPEN
Authenticated decryption: KeyHandle.open.

MAC

MAC
Message authentication: KeyHandle.mac.

VERIFY_MAC

VERIFY_MAC
Verification of a tag produced by MAC.

WRAP

WRAP
Wrapping another key. Separate from SEAL so a key that only protects other keys cannot be pointed at application data, and the reverse.

UNWRAP

UNWRAP
Unwrapping a key wrapped under WRAP.

Method details

values

public static KeyUsage[] values()

valueOf

public static KeyUsage valueOf(String name)