Package com.yubico.yubikit.fido.ctap
Class PinUvAuthDummyProtocol
java.lang.Object
com.yubico.yubikit.fido.ctap.PinUvAuthDummyProtocol
- All Implemented Interfaces:
PinUvAuthProtocol
Implements a dummy PIN/UV Auth Protocol
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
authenticate
(byte[] key, byte[] message) Computes a MAC of the given message.byte[]
decrypt
(byte[] key, byte[] demCiphertext) Decrypts a ciphertext and returns the plaintext.encapsulate
(Map<Integer, ?> peerCoseKey) Generates an encapsulation for the authenticator’s public key and returns the message to transmit and the shared secret.byte[]
encrypt
(byte[] key, byte[] demPlaintext) 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 secret
-
Constructor Details
-
PinUvAuthDummyProtocol
public PinUvAuthDummyProtocol()
-
-
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
- Returns:
- the version of the protocol
-
encapsulate
public com.yubico.yubikit.core.util.Pair<Map<Integer,?>, encapsulatebyte[]> (Map<Integer, ?> peerCoseKey) Description copied from interface:PinUvAuthProtocol
Generates an encapsulation for the authenticator’s public key and returns the message to transmit and the shared secret.- Specified by:
encapsulate
in interfacePinUvAuthProtocol
- Parameters:
peerCoseKey
- a public key returned by the YubiKey- Returns:
- a Pair containing a keyAgreement to transmit, and the shared secret.
-
encrypt
public byte[] encrypt(byte[] key, byte[] demPlaintext) 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
- Parameters:
key
- the secret key to usedemPlaintext
- the value to encrypt- Returns:
- the encrypted value
-
decrypt
public byte[] decrypt(byte[] key, byte[] demCiphertext) Description copied from interface:PinUvAuthProtocol
Decrypts a ciphertext and returns the plaintext.- Specified by:
decrypt
in interfacePinUvAuthProtocol
- Parameters:
key
- the secret key to usedemCiphertext
- 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
- Parameters:
key
- the secret key to usemessage
- the message to sign- Returns:
- a signature
-
kdf
public byte[] kdf(byte[] z) Description copied from interface:PinUvAuthProtocol
Computes shared secret- Specified by:
kdf
in interfacePinUvAuthProtocol
-