Module io.github.mmm.crypto.bc
Class Secp256k1<S extends SignatureEcBc>
- java.lang.Object
-
- io.github.mmm.crypto.CryptoAccess
-
- io.github.mmm.crypto.asymmetric.access.AsymmetricAccess<S,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc,AsymmetricKeyCreatorEcBc>
-
- io.github.mmm.crypto.asymmetric.access.ec.bc.AsymmetricAccessEcBc<S>
-
- io.github.mmm.crypto.asymmetric.access.ec.bc.Secp256k1<S>
-
- Type Parameters:
S
- type ofSignatureBinary
.
- All Implemented Interfaces:
AbstractCryptoFactory
,AsymmetricCryptorFactory<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
,AsymmetricKeyCreatorFactory<AsymmetricKeyCreatorEcBc>
,SignatureFactory<S>
,SignatureProcessorFactory<S,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
,CryptorFactory
,HashFactory
,KeyCreatorFactory
public class Secp256k1<S extends SignatureEcBc> extends AsymmetricAccessEcBc<S>
AsymmetricAccessEcBc
forSecP256K1Curve
.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static CryptoEllipticCurveBc
CURVE
Theelliptic curve
.static String
CURVE_NAME
Thecurve name
.-
Fields inherited from class io.github.mmm.crypto.asymmetric.access.ec.bc.AsymmetricAccessEcBc
ecParameters
-
Fields inherited from class io.github.mmm.crypto.asymmetric.access.AsymmetricAccess
cryptorConfig, randomFactory
-
-
Constructor Summary
Constructors Constructor Description Secp256k1(SignatureFactoryEcBc<S> signatureFactory, HashConfig hashConfig, RandomFactory randomFactory)
The constructor.Secp256k1(SignatureConfig<S> signatureConfig, AsymmetricCryptorConfigEcIes<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey> cryptorConfig, RandomFactory randomFactory)
The constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S extends SignatureEcBc>
Secp256k1<S>of(SignatureFactoryEcBc<S> signatureFactory, HashConfig hashConfig, RandomFactory randomFactory)
static Secp256k1<SignatureEcBcPlain>
ofPlain(HashConfig hashConfig)
static Secp256k1<SignatureEcBcPlain>
ofPlain(String hashAlgorithm)
static Secp256k1<SignatureEcBcWithRecoveryId>
ofRecoveryId(HashConfig hashConfig)
static Secp256k1<SignatureEcBcWithRecoveryId>
ofRecoveryId(String hashAlgorithm)
-
Methods inherited from class io.github.mmm.crypto.asymmetric.access.ec.bc.AsymmetricAccessEcBc
newKeyCreator
-
Methods inherited from class io.github.mmm.crypto.asymmetric.access.AsymmetricAccess
createSignature, getCryptorConfig, getSignatureConfig, getSignatureFactoryWithoutHash, newDecryptor, newDecryptorUnsafe, newEncryptor, newEncryptorUnsafe, newHashCreator, newSigner, newVerifier
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.sign.SignatureProcessorFactory
newSignerUnsafe, newVerifierUnsafe
-
-
-
-
Field Detail
-
CURVE_NAME
public static final String CURVE_NAME
Thecurve name
.- See Also:
- Constant Field Values
-
CURVE
public static final CryptoEllipticCurveBc CURVE
Theelliptic curve
.
-
-
Constructor Detail
-
Secp256k1
public Secp256k1(SignatureConfig<S> signatureConfig, AsymmetricCryptorConfigEcIes<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey> cryptorConfig, RandomFactory randomFactory)
The constructor.- Parameters:
signatureConfig
- theSignatureConfig
.cryptorConfig
- theAsymmetricCryptorConfigEcIes
.randomFactory
- the optionalRandomFactory
.
-
Secp256k1
public Secp256k1(SignatureFactoryEcBc<S> signatureFactory, HashConfig hashConfig, RandomFactory randomFactory)
The constructor.- Parameters:
signatureFactory
- theSignatureFactoryEcBc
.hashConfig
- theHashConfig
for the hash used for signatures.randomFactory
- theRandomFactory
.
-
-
Method Detail
-
ofPlain
public static Secp256k1<SignatureEcBcPlain> ofPlain(String hashAlgorithm)
-
ofPlain
public static Secp256k1<SignatureEcBcPlain> ofPlain(HashConfig hashConfig)
- Parameters:
hashConfig
- theHashConfig
for the hash used for signatures.- Returns:
- a
Secp256k1
instance for default signature.
-
ofRecoveryId
public static Secp256k1<SignatureEcBcWithRecoveryId> ofRecoveryId(String hashAlgorithm)
-
ofRecoveryId
public static Secp256k1<SignatureEcBcWithRecoveryId> ofRecoveryId(HashConfig hashConfig)
- Parameters:
hashConfig
- theHashConfig
for the hash used for signatures.- Returns:
- a
Secp256k1
instance for bitcoin signature.
-
of
public static <S extends SignatureEcBc> Secp256k1<S> of(SignatureFactoryEcBc<S> signatureFactory, HashConfig hashConfig, RandomFactory randomFactory)
- Type Parameters:
S
- type ofsignature
.- Parameters:
signatureFactory
- theSignatureFactoryEcBc
.hashConfig
- theHashConfig
for the hash used for signatures.randomFactory
- theRandomFactory
.- Returns:
- a
Secp256k1
instance for the given parameters.
-
-