x509util

package
v0.37.5 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 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

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

func GetRsaPrivateKeyForPkcs1PrivateKeyBytesWithPassword

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

func GetRsaPrivateKeyForPkcs1PrivateKeyPath

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

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

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