mixin

KeyStore

const mixin KeyStore

KeyStore stores keys[Key] and certificates[Cert] in an aliased [keystore entry](KeyStoreEntry). Aliases are case-insensitive.

See Crypto.loadKeyStore

methods aliases

Get all the aliases in the key store

containsAlias

Return ture if the key store has an entry with the given alias

format

Get the format that this keystore stores entries in

get

Get the entry with the given alias

getPrivKey

Convenience to get a PrivKeyEntry from the keystore

getTrust

Convenience to get a TrustEntry from the keystore

remove

Remove the entry with the given alias

save

Save the entries in the keystore to the output stream

set

Set an alias to have the given entry

setPrivKey

Adds a PrivKeyEntry to the keystore with the given alias and returns it

setTrust

Adds a TrustEntry to the keystore with the given alias and returns it

size

Get the number of entries in the key store

aliases abstract Str[] aliases()

Get all the aliases in the key store.

containsAlias virtual Bool containsAlias(Str alias)

Return ture if the key store has an entry with the given alias.

format abstract Str format()

Get the format that this keystore stores entries in.

get abstract KeyStoreEntry? get(Str alias, Bool checked := true)

Get the entry with the given alias.

getPrivKey virtual PrivKeyEntry? getPrivKey(Str alias, Bool checked := true)

Convenience to get a PrivKeyEntry from the keystore.

getTrust virtual TrustEntry? getTrust(Str alias, Bool checked := true)

Convenience to get a TrustEntry from the keystore.

remove abstract Void remove(Str alias)

Remove the entry with the given alias.

Throws Err if the key store is not writable.

save abstract Void save(OutStream out, Str:Obj options := [:])

Save the entries in the keystore to the output stream.

set abstract This set(Str alias, KeyStoreEntry entry)

Set an alias to have the given entry. If the alias already exists, it is overwritten.

Throws Err if the key store is not writable.

Throws Err if the key store doesn't support writing the entry type.

setPrivKey abstract This setPrivKey(Str alias, PrivKey priv, Cert[] chain, Str:Str attrs := [:])

Adds a PrivKeyEntry to the keystore with the given alias and returns it.

Optionally add entry attributes (recommended attribute names are ASN.1 OIDs):

["1.3.6.1.4.1.99999.1": "Custom attribute",
 "1.2.840.113549.1.9.20": "friendlyName"]

setTrust abstract This setTrust(Str alias, Cert cert)

Adds a TrustEntry to the keystore with the given alias and returns it.

size abstract Int size()

Get the number of entries in the key store.

Haxall 4.0.6 ∙ 21-Jul-2026 09:48 EDT