Package org.bitcoinj.crypto
Class AesKey
- java.lang.Object
-
- org.bitcoinj.crypto.AesKey
-
public class AesKey extends java.lang.Object
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[]
bytes()
byte[]
getKey()
Deprecated.Usebytes()
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
-
bytes
public byte[] bytes()
- Returns:
- The key bytes
-
getKey
@Deprecated public byte[] getKey()
Deprecated.Usebytes()
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
-
-