Package org.bitcoinj.crypto
Interface EncryptableItem
-
- All Known Implementing Classes:
DeterministicKey,DeterministicSeed,ECKey
public interface EncryptableItemProvides 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.util.Optional<java.time.Instant>creationTime()Returns the time at which this encryptable item was first created/derived, or empty of unknown.default longgetCreationTimeSeconds()Deprecated.usecreationTime()EncryptedDatagetEncryptedData()Returns the initialization vector and encrypted secret bytes, or null if not encrypted.Protos.Wallet.EncryptionTypegetEncryptionType()Returns an enum constant describing what algorithm was used to encrypt the key or UNENCRYPTED.byte[]getSecretBytes()Returns the raw bytes of the item, if not encrypted, or null if encrypted or the secret is missing.booleanisEncrypted()Returns whether the item is encrypted or not.
-
-
-
Method Detail
-
isEncrypted
boolean isEncrypted()
Returns whether the item is encrypted or not. If it is, thengetSecretBytes()will return null.
-
getSecretBytes
@Nullable byte[] getSecretBytes()
Returns the raw bytes of the item, if not encrypted, or null if encrypted or the secret is missing.
-
getEncryptedData
@Nullable EncryptedData getEncryptedData()
Returns the initialization vector and encrypted secret bytes, or null if not encrypted.
-
getEncryptionType
Protos.Wallet.EncryptionType getEncryptionType()
Returns an enum constant describing what algorithm was used to encrypt the key or UNENCRYPTED.
-
creationTime
java.util.Optional<java.time.Instant> creationTime()
Returns the time at which this encryptable item was first created/derived, or empty of unknown.
-
getCreationTimeSeconds
@Deprecated default long getCreationTimeSeconds()
Deprecated.usecreationTime()
-
-