Show / Hide Table of Contents

Encapsulate Method

Encapsulate(CoseKey)

Generates a new platform key pair and uses the private key along with the peerPublicKey to compute the shared value. It then derives the shared keys (encryption and authentication) from the shared value.

C#
public virtual void Encapsulate(CoseKey authenticatorPublicKey)

Parameters

Type Name Description
CoseKey authenticatorPublicKey

The YubiKey's public key obtained by calling the GetKeyAgreementCommand.

Exceptions

Type Condition
ArgumentNullException

The authenticatorPublicKey argument is null.

ArgumentException

The authenticatorPublicKey argument is not an appropriate key object (e.g. wrong algorithm).

InvalidOperationException

The object is not available for Encapsulate because it still contains data from a previous operation. It is necessary to call Initialize before reusing a Protocol object.

Remarks

This will generate a new public and private key, compute the shared value, and discard the private key. The resulting public key will be found in the PlatformPublicKey property, and the derived keys will be found in the EncryptionKey and AuthenticationKey properties.

This method can be called only after instantiation or a call to Initialize(). Otherwise, this method will throw an exception.

In this article
Back to top Generated by DocFX