Export-CertificateForNuGet
Exports a code-signing certificate to DER format for NuGet.org registration.
Syntax
Export-CertificateForNuGet -CertificateThumbprint <String> [-LocalStore <CurrentUser|LocalMachine>] [-OutputPath <String>] [<CommonParameters>]#ThumbprintExport-CertificateForNuGet -CertificateSha256 <String> [-LocalStore <CurrentUser|LocalMachine>] [-OutputPath <String>] [<CommonParameters>]#Sha256Description
NuGet.org requires uploading the public certificate (.cer) used for package signing. This cmdlet exports the selected certificate from the local certificate store.
Examples
Export by thumbprint
Export-CertificateForNuGet -CertificateThumbprint '0123456789ABCDEF' -OutputPath (Join-Path $env:TEMP 'NuGetSigning.cer')Exports the certificate in DER format to the given path.
Export by SHA256 hash
Export-CertificateForNuGet -CertificateSha256 '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF'Useful when you have the SHA256 fingerprint but not the Windows thumbprint.
Parameters
- -CertificateThumbprint String
- The SHA1 thumbprint of the certificate to export.
- -LocalStore CertificateStoreLocation
- Certificate store location to use.
- Possible values:
CurrentUser,LocalMachine - -OutputPath String
- Output path for the exported .cer file.
- -CertificateSha256 String
- The SHA256 hash of the certificate to export.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.