Documentation ¶
Overview ¶
Package jceks parses JCEKS (Java Cryptogaphy Extension Key Store) files and extracts keys and certificates. This module only implements a fraction of the JCEKS cryptographic protocols. In particular, it implements the SHA1 signature verification of the key store and the PBEWithMD5AndDES3CBC cipher for encrypting private keys.
Index ¶
- type KeyStore
- func (ks *KeyStore) GetCert(alias string) (*x509.Certificate, error)
- func (ks *KeyStore) GetPrivateKeyAndCerts(alias string, password []byte) (key crypto.PrivateKey, certs []*x509.Certificate, err error)
- func (ks *KeyStore) ListCerts() []string
- func (ks *KeyStore) ListPrivateKeys() []string
- func (ks *KeyStore) Parse(r io.Reader, password []byte) error
- func (ks *KeyStore) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
KeyStore maintains a map from alias name to the entry for that alias. Entries are currently either privateKeyEntry or trustedCertEntry.
func LoadFromFile ¶
LoadFromFile loads the key store from the specified file.
func LoadFromReader ¶
LoadFromReader loads the key store from the specified file.
func (*KeyStore) GetCert ¶
func (ks *KeyStore) GetCert(alias string) (*x509.Certificate, error)
GetCert retrieves the specified certificate. Returns nil if the certificate does not exist or alias points to a non certificate entry.
func (*KeyStore) GetPrivateKeyAndCerts ¶
func (ks *KeyStore) GetPrivateKeyAndCerts(alias string, password []byte) ( key crypto.PrivateKey, certs []*x509.Certificate, err error)
GetPrivateKeyAndCerts retrieves the specified private key. Returns nil if the private key does not exist or alias points to a non private key entry.
func (*KeyStore) ListPrivateKeys ¶
ListPrivateKeys lists the names of the private keys stored in the key store.