BksKeyStore class

BKS (Bouncy Castle KeyStore) parser.

This class parses BKS-V1 and BKS-V2 keystore files.

BKS file format:

  • Version: 4 bytes (1 or 2)
  • Salt: length-prefixed bytes
  • Iteration count: 4 bytes
  • Entries: variable, null-terminated
  • HMAC: 20 bytes (SHA-1)
Inheritance

Constructors

BksKeyStore(String storeType, Map<String, KeystoreEntry> entries, {int version = 2})

Properties

certs → Map<String, TrustedCertEntry>
Returns all trusted certificate entries.
no setteroverride
entries → Map<String, KeystoreEntry>
Map of aliases to entries.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
plainKeys → Map<String, BksKeyEntry>
Returns all plain key entries.
no setter
privateKeys → Map<String, PrivateKeyEntry>
Returns all private key entries.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sealedKeys → Map<String, BksSealedKeyEntry>
Returns all sealed key entries.
no setter
storeType → String
The type of keystore (e.g., "jks", "jceks", "bks").
finalinherited
version → int
The version of this keystore (1 or 2).
final

Methods

getAllCertificates() → List<Uint8List>
Gets all certificates from the keystore as DER-encoded bytes.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(String storePassword, {String? keyPassword}) → Uint8List
Saves the keystore to BKS format bytes (Version 2).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

load(Uint8List data, {String? storePassword, bool tryDecryptKeys = true}) → BksKeyStore
Loads a BKS keystore from bytes.