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
Fields -
Constructor Summary
Constructors -
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.intReturns 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:PinUvAuthProtocolReturns the version number of the PIN/UV Auth protocol.- Specified by:
getVersionin interfacePinUvAuthProtocol- Overrides:
getVersionin classPinUvAuthProtocolV1- Returns:
- the version of the protocol
-
kdf
public byte[] kdf(byte[] z) Description copied from interface:PinUvAuthProtocolComputes shared secret- Specified by:
kdfin interfacePinUvAuthProtocol- Overrides:
kdfin classPinUvAuthProtocolV1
-
encrypt
public byte[] encrypt(byte[] key, byte[] plaintext) Description copied from interface:PinUvAuthProtocolEncrypts 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:
encryptin interfacePinUvAuthProtocol- Overrides:
encryptin 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:PinUvAuthProtocolDecrypts a ciphertext and returns the plaintext.- Specified by:
decryptin interfacePinUvAuthProtocol- Overrides:
decryptin 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:PinUvAuthProtocolComputes a MAC of the given message.- Specified by:
authenticatein interfacePinUvAuthProtocol- Overrides:
authenticatein classPinUvAuthProtocolV1- Parameters:
key- the secret key to usemessage- the message to sign- Returns:
- a signature
-