Enum KeyUsage
- All Implemented Interfaces:
Comparable<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 Constant Summary
Enum ConstantsEnum ConstantDescriptionMessage authentication:KeyHandle.mac(byte[]).Authenticated decryption:KeyHandle.open(byte[], AssociatedData).Authenticated encryption:KeyHandle.seal(byte[], AssociatedData).Unwrapping a key wrapped underWRAP.Verification of a tag produced byMAC.Wrapping another key. -
Method Summary
Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
SEAL
Authenticated encryption:KeyHandle.seal(byte[], AssociatedData). -
OPEN
Authenticated decryption:KeyHandle.open(byte[], AssociatedData). -
MAC
Message authentication:KeyHandle.mac(byte[]). -
VERIFY_MAC
-
WRAP
-
UNWRAP
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-