Package org.bitcoinj.crypto
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 Provides a uniform way to access something that can be optionally encrypted with aKeyCrypter
, yielding anEncryptedData
, and which can have a creation time associated with it.KeyCrypter A KeyCrypter can be used to encrypt and decrypt a message.TrustStoreLoader An implementation of TrustStoreLoader handles fetching a KeyStore from the operating system, a file, etc. -
Class Summary Class Description AesKey Wrapper for abyte[]
containing an AES Key.BIP38PrivateKey Implementation of BIP 38 passphrase-protected private keys.ChildNumber This 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.DeterministicHierarchy A DeterministicHierarchy calculates and keeps a whole tree (hierarchy) of keys originating from a single root key.DeterministicKey A deterministic key is a node in aDeterministicHierarchy
.DumpedPrivateKey Parses and generates private keys in the form used by the Bitcoin "dumpprivkey" command.ECKey Represents an elliptic curve public and (optionally) private key, usable for digital signatures but not encryption.ECKey.ECDSASignature Groups the two components that make up a signature, and provides a way to encode to DER form, which is how ECDSA signatures are represented when embedded in other data structures in the Bitcoin protocol.EncodedPrivateKey Some form of string-encoded private key.EncryptedData An instance of EncryptedData is a holder for an initialization vector and encrypted bytes.HDKeyDerivation Implementation of the BIP 32 deterministic wallet child key generation algorithm.HDKeyDerivation.RawKeyBytes HDPath HD Key derivation path.HDUtils Static utilities used in BIP 32 Hierarchical Deterministic Wallets (HDW).KeyCrypterScrypt This class encrypts and decrypts byte arrays and strings using scrypt as the key derivation function and AES for the encryption.LazyECPoint A wrapper around ECPoint that delays decoding of the point for as long as possible.LinuxSecureRandom A SecureRandom implementation that is able to override the standard JVM provided implementation, and which simply serves random numbers by reading /dev/urandom.MnemonicCode A MnemonicCode object may be used to convert between binary seed values and lists of words per the BIP 39 specificationPBKDF2SHA512 This is a clean-room implementation of PBKDF2 using RFC 2898 as a reference.TransactionSignature A TransactionSignature wraps anECKey.ECDSASignature
and adds methods for handling the additional SIGHASH mode byte that is used.TrustStoreLoader.DefaultTrustStoreLoader TrustStoreLoader.FileTrustStoreLoader X509Utils X509Utils 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 ECKey.KeyIsEncryptedException ECKey.MissingPrivateKeyException HDDerivationException KeyCrypterException Exception to provide the following:KeyCrypterException.InvalidCipherText This exception is thrown when a private key or seed is decrypted, the decrypted message is damaged (e.g.KeyCrypterException.PublicPrivateMismatch This exception is thrown when a private key or seed is decrypted, it doesn't match its public key any more.MnemonicException Exceptions thrown by the MnemonicCode module.MnemonicException.MnemonicChecksumException Thrown when a list of MnemonicCode words fails the checksum check.MnemonicException.MnemonicLengthException Thrown when an argument to MnemonicCode is the wrong length.MnemonicException.MnemonicWordException Thrown when a word is encountered which is not in the MnemonicCode's word list.SignatureDecodeException