jceks

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 16 Imported by: 6

README

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.

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

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

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

LoadFromFile loads the key store from the specified file.

func LoadFromReader

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

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

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

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

func (*KeyStore) ListPrivateKeys

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

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

func (*KeyStore) Parse

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

Parse parses the key store from the specified reader.

func (*KeyStore) String

func (ks *KeyStore) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL