Show / Hide Table of Contents

PivEccPrivateKey Constructor

PivEccPrivateKey(ReadOnlySpan<byte>, PivAlgorithm?)

Create a new instance of an ECC private key object based on the given private value.

C#
public PivEccPrivateKey(ReadOnlySpan<byte> privateValue, PivAlgorithm? algorithm = null)

Parameters

Type Name Description
ReadOnlySpan<byte> privateValue

The private value to use to build the object.

PivAlgorithm? algorithm

The algorithm used, if empty, it will be determined at best effort.

Exceptions

Type Condition
ArgumentException

The size of the private value is not supported by the YubiKey.

Remarks

The private value will be a "byte array", no tags or length octets. For PivAlgorithm.EccP256 it must be 32 bytes. For PivAlgorithm.EccP384 it must be 48 bytes.

The class will determine the algorithm (PivAlgorithm.EccP256 or PivAlgorithm.EccP384) based on the size of the point.

In this article
Back to top Generated by DocFX