x509util

package
v0.64.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 7 Imported by: 0

README

x509util

Go utility code for handling X.509 certificates.

Certificate Formats

This library handles certificates using the PKCS standards. Key formats supported include PKCS #1 for private keys and PKCS #8 for public keys.

Converting OpenSSH key formats to PKCS key formats

This section includes commands on converting OpenSSH key file formats to the PKCS formats used by this library.

Converting Private Keys from OpenSSH to PKCS #1

To decrypt OpenSSH Private Key to OpenSSL PKCS1 Private Key Format, run the following command, assuming the standard id_rsa private key file name

openssl rsa -in id_rsa -out id_rsa.private.pkcs1

Converting Public Keys from OpenSSH to PKCS #8

To convert OpenSSH Public Key to OpenSSL PKCS8 Public Key Format, assuming the standard id_rsa.pub public key file name.

ssh-keygen -e -m PKCS8 -f id_rsa.pub > id_rsa.public.pkcs8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRSAPrivateKeyForPKCS1PrivateKeyBytes added in v0.47.0

func GetRSAPrivateKeyForPKCS1PrivateKeyBytes(prvKeyPkcs1Bytes []byte) (*rsa.PrivateKey, error)

func GetRSAPrivateKeyForPKCS1PrivateKeyBytesWithPassword added in v0.47.0

func GetRSAPrivateKeyForPKCS1PrivateKeyBytesWithPassword(prvKeyPkcs1BytesEnc []byte, password []byte) (*rsa.PrivateKey, error)

func GetRSAPrivateKeyForPKCS1PrivateKeyPath added in v0.47.0

func GetRSAPrivateKeyForPKCS1PrivateKeyPath(prvKeyPKCS1Path string) (*rsa.PrivateKey, error)

GetRsaPrivateKeyForPkcs1PrivateKeyPath returns a *rsa.PrivateKey for a given PKCS#1 private key file path without a password

func GetRSAPrivateKeyForPKCS1PrivateKeyPathWithPassword added in v0.47.0

func GetRSAPrivateKeyForPKCS1PrivateKeyPathWithPassword(prvKeyPKCS1Path string, password []byte) (*rsa.PrivateKey, error)

GetRSAPrivateKeyForPKCS1PrivateKeyPathWithPassword returns a *rsa.PrivateKey for a given PKCS#1 private key file path and password

func GetRSAPublicKeyForPKCS8PublicKeyPath added in v0.47.0

func GetRSAPublicKeyForPKCS8PublicKeyPath(pubKeyPkcs8Path string) (*rsa.PublicKey, error)

GetRSAPublicKeyForPKCS8PublicKeyPath returns a *rsa.PublicKey for a given PKCS#8 public key file path.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL