Package com.yubico.yubikit.fido.ctap
Class PinUvAuthProtocolV2
java.lang.Object
com.yubico.yubikit.fido.ctap.PinUvAuthProtocolV1
com.yubico.yubikit.fido.ctap.PinUvAuthProtocolV2
- All Implemented Interfaces:
PinUvAuthProtocol
Implements PIN/UV Auth Protocol 2
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
authenticate
(byte[] key, byte[] message) Computes a MAC of the given message.byte[]
decrypt
(byte[] key, byte[] ciphertext) Decrypts a ciphertext and returns the plaintext.byte[]
encrypt
(byte[] key, byte[] plaintext) Encrypts a plaintext to produce a ciphertext, which may be longer than the plaintext.int
Returns the version number of the PIN/UV Auth protocol.byte[]
kdf
(byte[] z) Computes shared secretMethods inherited from class com.yubico.yubikit.fido.ctap.PinUvAuthProtocolV1
encapsulate
-
Field Details
-
VERSION
public static final int VERSION- See Also:
-
-
Constructor Details
-
PinUvAuthProtocolV2
public PinUvAuthProtocolV2()
-
-
Method Details
-
getVersion
public int getVersion()Description copied from interface:PinUvAuthProtocol
Returns the version number of the PIN/UV Auth protocol.- Specified by:
getVersion
in interfacePinUvAuthProtocol
- Overrides:
getVersion
in classPinUvAuthProtocolV1
- Returns:
- the version of the protocol
-
kdf
public byte[] kdf(byte[] z) Description copied from interface:PinUvAuthProtocol
Computes shared secret- Specified by:
kdf
in interfacePinUvAuthProtocol
- Overrides:
kdf
in classPinUvAuthProtocolV1
-
encrypt
public byte[] encrypt(byte[] key, byte[] plaintext) Description copied from interface:PinUvAuthProtocol
Encrypts a plaintext to produce a ciphertext, which may be longer than the plaintext. The plaintext is restricted to being a multiple of the AES block size (16 bytes) in length.- Specified by:
encrypt
in interfacePinUvAuthProtocol
- Overrides:
encrypt
in classPinUvAuthProtocolV1
- Parameters:
key
- the secret key to useplaintext
- the value to encrypt- Returns:
- the encrypted value
-
decrypt
public byte[] decrypt(byte[] key, byte[] ciphertext) Description copied from interface:PinUvAuthProtocol
Decrypts a ciphertext and returns the plaintext.- Specified by:
decrypt
in interfacePinUvAuthProtocol
- Overrides:
decrypt
in classPinUvAuthProtocolV1
- Parameters:
key
- the secret key to useciphertext
- the value to decrypt- Returns:
- the decrypted value
-
authenticate
public byte[] authenticate(byte[] key, byte[] message) Description copied from interface:PinUvAuthProtocol
Computes a MAC of the given message.- Specified by:
authenticate
in interfacePinUvAuthProtocol
- Overrides:
authenticate
in classPinUvAuthProtocolV1
- Parameters:
key
- the secret key to usemessage
- the message to sign- Returns:
- a signature
-