Package org.bitcoinj.crypto
Class AesKey
java.lang.Object
org.bitcoinj.base.internal.ByteArray
org.bitcoinj.crypto.AesKey
- All Implemented Interfaces:
Comparable<ByteArray>
Wrapper for a
byte[] containing an AES Key. This is a replacement for Bouncy Castle's KeyParameter which
was used for this purpose in previous versions of bitcoinj. Unfortunately, this created a Gradle _API_ dependency
on Bouncy Castle when that wasn't strictly necessary.
We have made this change without deprecation because it affected many method signatures and because updating is a trivial change.
If for some reason you have code that uses the Bouncy Castle KeyParameter type and need to convert
to or from AesKey, you can temporarily use ofKeyParameter(KeyParameter) or toKeyParameter()
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getKey()Deprecated.static AesKeyofKeyParameter(org.bouncycastle.crypto.params.KeyParameter keyParameter) Deprecated.Usenew AesKey(keyParameter.bytes())org.bouncycastle.crypto.params.KeyParameterDeprecated.Usenew KeyParameter(key.bytes)
-
Constructor Details
-
AesKey
public AesKey(byte[] keyBytes) Wrapper for abyte[]containing an AES Key- Parameters:
keyBytes- implementation-dependent AES Key bytes
-
-
Method Details
-
getKey
Deprecated.Provided to ease migration fromKeyParameter.- Returns:
- The key bytes
-
ofKeyParameter
@Deprecated public static AesKey ofKeyParameter(org.bouncycastle.crypto.params.KeyParameter keyParameter) Deprecated.Usenew AesKey(keyParameter.bytes())Provided to ease migration fromKeyParameter.- Parameters:
keyParameter- instance to convert- Returns:
- new, preferred container for AES keys
-
toKeyParameter
Deprecated.Usenew KeyParameter(key.bytes)Provided to ease migration fromKeyParameter.- Returns:
- if for some reason you still need (temporarily, we hope) a
KeyParameter
-
ByteArray.bytes()