Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKeyPair ¶
func NewKeyPair(bits int) (*PrivateKey, *PublicKey, error)
NewKeyPair creates a new RSA private key with the given number of bits. Minimum bit size is 1024 and must be a multiple of 8.
func NewKeyPair1024 ¶
func NewKeyPair1024() (*PrivateKey, *PublicKey, error)
NewKeyPair1024 creates a new RSA private key with 1024 bits.
func NewKeyPair2048 ¶
func NewKeyPair2048() (*PrivateKey, *PublicKey, error)
NewKeyPair2048 creates a new RSA private key with 2048 bits.
func NewKeyPair4096 ¶
func NewKeyPair4096() (*PrivateKey, *PublicKey, error)
NewKeyPair4096 creates a new RSA private key with 4096 bits.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
RawKey *rsa.PrivateKey
}
RSA Private Key
func NewPrivateFromPEM ¶
func NewPrivateFromPEM(pemStr string) (*PrivateKey, error)
NewPrivateFromPEM creates a new private key from a PEM encoded string
func (*PrivateKey) BitsSize ¶
func (k *PrivateKey) BitsSize() int
BitsSize returns the size of the private key in bits
func (*PrivateKey) BytesSize ¶
func (k *PrivateKey) BytesSize() int
BytesSize returns the size of the private key in bytes
Click to show internal directories.
Click to hide internal directories.