Documentation ¶
Index ¶
- func PEMDecode(data []byte) ([]byte, []byte)
- func PEMEncode(name string, data []byte) []byte
- func PEMTryDecode(data []byte) ([]byte, []byte)
- func ReadRSAKey(filename string) (*rsa.PrivateKey, *rsa.PublicKey, error)
- type Container
- func NewDERContainer(data []byte) (*Container, error)
- func NewECDSAPrivateKeyContainer(key *ecdsa.PrivateKey) *Container
- func NewECDSAPublicKeyContainer(key *ecdsa.PublicKey) *Container
- func NewRSAPrivateKeyContainer(key *rsa.PrivateKey) *Container
- func NewRSAPublicKeyContainer(key *rsa.PublicKey) *Container
- func ParseContainerChain(data []byte) (*Container, error)
- func ParseContainerChainFromFile(filename string) (*Container, error)
- func (c *Container) Certificate() *x509.Certificate
- func (c *Container) CertificateRequest() *x509.CertificateRequest
- func (c *Container) ECDSAPrivateKey() *ecdsa.PrivateKey
- func (c *Container) ECDSAPublicKey() *ecdsa.PublicKey
- func (c *Container) FirstPrivateKey() crypto.PrivateKey
- func (c *Container) FirstPublicKey() crypto.PublicKey
- func (c *Container) KeyType() KeyType
- func (c *Container) KeyTypeString() string
- func (c *Container) Next() *Container
- func (c *Container) PrivateKey() crypto.PrivateKey
- func (c *Container) PublicKey() crypto.PublicKey
- func (c *Container) RSAPrivateKey() *rsa.PrivateKey
- func (c *Container) RSAPublicKey() *rsa.PublicKey
- type KeyFileFormat
- type KeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PEMTryDecode ¶
func ReadRSAKey ¶
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewDERContainer ¶
func NewECDSAPrivateKeyContainer ¶
func NewECDSAPrivateKeyContainer(key *ecdsa.PrivateKey) *Container
func NewRSAPrivateKeyContainer ¶
func NewRSAPrivateKeyContainer(key *rsa.PrivateKey) *Container
func ParseContainerChain ¶
func (*Container) Certificate ¶
func (c *Container) Certificate() *x509.Certificate
func (*Container) CertificateRequest ¶
func (c *Container) CertificateRequest() *x509.CertificateRequest
func (*Container) ECDSAPrivateKey ¶
func (c *Container) ECDSAPrivateKey() *ecdsa.PrivateKey
func (*Container) ECDSAPublicKey ¶
func (*Container) FirstPrivateKey ¶
func (c *Container) FirstPrivateKey() crypto.PrivateKey
func (*Container) FirstPublicKey ¶
func (*Container) KeyTypeString ¶
func (*Container) PrivateKey ¶
func (c *Container) PrivateKey() crypto.PrivateKey
func (*Container) RSAPrivateKey ¶
func (c *Container) RSAPrivateKey() *rsa.PrivateKey
func (*Container) RSAPublicKey ¶
type KeyFileFormat ¶
type KeyFileFormat int
const ( KeyFileFormatInvalid KeyFileFormat = iota KeyFileFormatPKCS1RSAPrivateKey KeyFileFormatPKCS1RSAPublicKey KeyFileFormatPKCS7Message KeyFileFormatPKCS8PrivateKey KeyFileFormatPKIXPublicKey KeyFileFormatECPrivateKey KeyFileFormatECPublicKey KeyFileFormatECParameters KeyFileFormatCertificate KeyFileFormatCertificateRequest KeyFileFormatPEM )
func TypeDetect ¶
func TypeDetect(data []byte) []KeyFileFormat
func (KeyFileFormat) String ¶
func (f KeyFileFormat) String() string
Click to show internal directories.
Click to hide internal directories.