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
Constructors -
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.intReturns 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:PinUvAuthProtocolReturns the version number of the PIN/UV Auth protocol.- Specified by:
getVersionin 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:PinUvAuthProtocolGenerates an encapsulation for the authenticator’s public key and returns the message to transmit and the shared secret.- Specified by:
encapsulatein 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: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- 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:PinUvAuthProtocolDecrypts a ciphertext and returns the plaintext.- Specified by:
decryptin 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:PinUvAuthProtocolComputes a MAC of the given message.- Specified by:
authenticatein 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:PinUvAuthProtocolComputes shared secret- Specified by:
kdfin interfacePinUvAuthProtocol
-