The crypto package contains classes that work with key derivation algorithms like scrypt (passwords to AES keys), BIP 32 hierarchies (chains of keys from a root seed), X.509 utilities for the payment protocol and other general cryptography tasks. It also contains a class that can disable the (long since obsolete) DRM Java/US Govt imposes on strong crypto. This is legal because Oracle got permission to ship strong AES to everyone years ago but hasn't bothered to actually remove the logic barriers.
Interface Summary Interface Description EncryptableItem KeyCrypterA KeyCrypter can be used to encrypt and decrypt a message. TrustStoreLoaderAn implementation of TrustStoreLoader handles fetching a KeyStore from the operating system, a file, etc.
Class Summary Class Description BIP38PrivateKeyImplementation of BIP 38 passphrase-protected private keys. ChildNumberThis is just a wrapper for the i (child number) as per BIP 32 with a boolean getter for the most significant bit and a getter for the actual 0-based child number. DeterministicHierarchyA DeterministicHierarchy calculates and keeps a whole tree (hierarchy) of keys originating from a single root key. DeterministicKeyA deterministic key is a node in a
DRMWorkaround EncryptedDataAn instance of EncryptedData is a holder for an initialization vector and encrypted bytes. HDKeyDerivationImplementation of the BIP 32 deterministic wallet child key generation algorithm. HDKeyDerivation.RawKeyBytes HDPathHD Key derivation path. HDUtilsStatic utilities used in BIP 32 Hierarchical Deterministic Wallets (HDW). KeyCrypterScryptThis class encrypts and decrypts byte arrays and strings using scrypt as the key derivation function and AES for the encryption. LazyECPointA wrapper around ECPoint that delays decoding of the point for as long as possible. LinuxSecureRandomA SecureRandom implementation that is able to override the standard JVM provided implementation, and which simply serves random numbers by reading /dev/urandom. MnemonicCodeA MnemonicCode object may be used to convert between binary seed values and lists of words per the BIP 39 specification PBKDF2SHA512This is a clean-room implementation of PBKDF2 using RFC 2898 as a reference. TransactionSignatureA TransactionSignature wraps an
ECKey.ECDSASignatureand adds methods for handling the additional SIGHASH mode byte that is used.
TrustStoreLoader.DefaultTrustStoreLoader TrustStoreLoader.FileTrustStoreLoader X509UtilsX509Utils provides tools for working with X.509 certificates and keystores, as used in the BIP 70 payment protocol.
Enum Summary Enum Description HDKeyDerivation.PublicDeriveMode
Exception Summary Exception Description BIP38PrivateKey.BadPassphraseException HDDerivationException KeyCrypterExceptionException to provide the following: KeyCrypterException.InvalidCipherTextThis exception is thrown when a private key or seed is decrypted, the decrypted message is damaged (e.g. KeyCrypterException.PublicPrivateMismatchThis exception is thrown when a private key or seed is decrypted, it doesn't match its public key any more. MnemonicExceptionExceptions thrown by the MnemonicCode module. MnemonicException.MnemonicChecksumExceptionThrown when a list of MnemonicCode words fails the checksum check. MnemonicException.MnemonicLengthExceptionThrown when an argument to MnemonicCode is the wrong length. MnemonicException.MnemonicWordExceptionThrown when a word is encountered which is not in the MnemonicCode's word list.