Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Module/Cmdlets/PIV/BuildYubiKeyPIVCertificateSigningRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ protected override void ProcessRecord()
CertificateRequest request;
X509SignatureGenerator signer;

// get the metadata catch if fails
// This is only supported on firmware 5.3.0 and newer.
if (((YubiKeyDevice)YubiKeyModule._yubikey!).FirmwareVersion < new FirmwareVersion(5, 3, 0))
{
throw new NotSupportedException("This feature requires firmware version 5.3.0 or newer.");
}

// get the metadata catch if fails
PivMetadata? metadata = null;
PivPublicKey? publicKey = null;
try
Expand Down Expand Up @@ -162,7 +168,8 @@ protected override void ProcessRecord()
}
else
{
WriteObject(requestSigned);
var csrObject = CertificateRequest.LoadSigningRequestPem(pemData.AsSpan(), HashAlgorithm, CertificateRequestLoadOptions.UnsafeLoadCertificateExtensions);
WriteObject(csrObject);
}
}
WriteDebug("ProcessRecord in New-YubikeyPIVCSR");
Expand Down