certigo: github.com/square/certigo/jceks Index | Files

package jceks

import "github.com/square/certigo/jceks"

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

Package Files

jceks.go pbe.go

type KeyStore Uses

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 Uses

func LoadFromFile(filename string, password []byte) (*KeyStore, error)

LoadFromFile loads the key store from the specified file.

func LoadFromReader Uses

func LoadFromReader(reader io.Reader, password []byte) (*KeyStore, error)

LoadFromReader loads the key store from the specified file.

func (*KeyStore) GetCert Uses

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 Uses

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) ListCerts Uses

func (ks *KeyStore) ListCerts() []string

ListCerts lists the names of the certs stored in the key store.

func (*KeyStore) ListPrivateKeys Uses

func (ks *KeyStore) ListPrivateKeys() []string

ListPrivateKeys lists the names of the private keys stored in the key store.

func (*KeyStore) Parse Uses

func (ks *KeyStore) Parse(r io.Reader, password []byte) error

Parse parses the key store from the specified reader.

func (*KeyStore) String Uses

func (ks *KeyStore) String() string

Package jceks imports 16 packages (graph) and is imported by 4 packages. Updated 2020-09-08. Refresh now. Tools for package owners.