Package org.bitcoinj.crypto
Class AesKey
- java.lang.Object
-
- org.bitcoinj.base.internal.ByteArray
-
- org.bitcoinj.crypto.AesKey
-
- All Implemented Interfaces:
java.lang.Comparable<ByteArray>
public class AesKey extends ByteArray
Wrapper for abyte[]
containing an AES Key. This is a replacement for Bouncy Castle'sKeyParameter
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 fromAesKey
, you can temporarily useofKeyParameter(KeyParameter)
ortoKeyParameter()
-
-
Constructor Summary
Constructors Constructor Description AesKey(byte[] keyBytes)
Wrapper for abyte[]
containing an AES Key
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description byte[]
getKey()
Deprecated.static AesKey
ofKeyParameter(org.bouncycastle.crypto.params.KeyParameter keyParameter)
Deprecated.Usenew AesKey(keyParameter.bytes())
org.bouncycastle.crypto.params.KeyParameter
toKeyParameter()
Deprecated.Usenew KeyParameter(key.bytes)
-
-
-
Method Detail
-
getKey
@Deprecated public byte[] 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 public org.bouncycastle.crypto.params.KeyParameter toKeyParameter()
Deprecated.Usenew KeyParameter(key.bytes)
Provided to ease migration fromKeyParameter
.- Returns:
- if for some reason you still need (temporarily, we hope) a
KeyParameter
-
-