Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoPassword = errors.New("password is not set for store") ErrInvalidAlias = errors.New("alias must not be an empty string") )
Functions ¶
This section is empty.
Types ¶
type KeystoreBuilder ¶
type KeystoreBuilder struct {
// contains filtered or unexported fields
}
KeystoreBuilder provides a builder interface to generate JKS keystores.
func NewKeystoreBuilder ¶
func NewKeystoreBuilder() *KeystoreBuilder
NewKeystoreBuilder creates a new KeyStoreBuilder.
func (*KeystoreBuilder) AddCert ¶
func (k *KeystoreBuilder) AddCert(alias string, cert []byte, key []byte, caCerts ...[]byte)
AddCert adds a certificate and private key to the key store. If an alias is reused, this overwrites the previous cert.
Parameters:
`alias` - Alias for cert/key pair `cert` - Certificate, in X.509 PEM format `key` - Private key, in PEM format `caCerts` - Optional intermediate certificate authorities to add to keypair, in X.509 PEM format
func (*KeystoreBuilder) Build ¶
func (k *KeystoreBuilder) Build() ([]byte, error)
Build constructs the keystore from the builder contents.
func (*KeystoreBuilder) SetPassword ¶
func (k *KeystoreBuilder) SetPassword(password string)
SetPassword sets the keystore password.
Click to show internal directories.
Click to hide internal directories.