Class SmartCardHSMPrivateKeySpec
- java.lang.Object
-
- de.cardcontact.opencard.service.smartcardhsm.SmartCardHSMKeySpec
-
- de.cardcontact.opencard.service.smartcardhsm.SmartCardHSMPrivateKeySpec
-
- All Implemented Interfaces:
java.security.spec.KeySpec
- Direct Known Subclasses:
SmartCardHSMECPrivateKeySpec
,SmartCardHSMRSAPrivateKeySpec
public abstract class SmartCardHSMPrivateKeySpec extends SmartCardHSMKeySpec
This class contains data for key pair generation.- Author:
- lew
- See Also:
KeySpec
-
-
Constructor Summary
Constructors Constructor Description SmartCardHSMPrivateKeySpec(java.lang.String car, java.lang.String chr)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ConstructedTLV
encodeKeyParams()
protected void
encodeSpecParams(Sequence cdata)
Encode key specification for asymmetric keys Overwritten in derived classesbyte[]
getAlgorithm()
byte[]
getCHR()
void
setAlgorithm(byte[] algorithm)
void
setCAR(java.lang.String car)
void
setCHR(java.lang.String certificateHolderReference)
void
setOuterCAR(java.lang.String outerCar)
void
setStorePublicKey(boolean storePublicKey)
boolean
storePublicKey()
protected static byte[]
unsignedBigIntegerToByteArray(java.math.BigInteger bi, int size)
Convert unsigned big integer into byte array, stripping of a leading 00 byte This conversion is required, because the Java BigInteger is a signed value, whereas the byte arrays containing key components are unsigned by default-
Methods inherited from class de.cardcontact.opencard.service.smartcardhsm.SmartCardHSMKeySpec
encodeKeyParams, getAlgorithmList, getCData, getKeyDomain, getKeyUseCounter, hasAlgorithmList, hasKeyDomain, hasKeyUseCounter, setAlgorithmList, setKeyDomain, setKeyUseCounter
-
-
-
-
Method Detail
-
getCHR
public byte[] getCHR()
-
setCHR
public void setCHR(java.lang.String certificateHolderReference)
-
getAlgorithm
public byte[] getAlgorithm()
-
setAlgorithm
public void setAlgorithm(byte[] algorithm)
-
setCAR
public void setCAR(java.lang.String car)
-
setOuterCAR
public void setOuterCAR(java.lang.String outerCar)
-
setStorePublicKey
public void setStorePublicKey(boolean storePublicKey)
-
storePublicKey
public boolean storePublicKey()
-
encodeKeyParams
protected abstract ConstructedTLV encodeKeyParams()
-
encodeSpecParams
protected void encodeSpecParams(Sequence cdata)
Description copied from class:SmartCardHSMKeySpec
Encode key specification for asymmetric keys Overwritten in derived classes- Overrides:
encodeSpecParams
in classSmartCardHSMKeySpec
- Parameters:
cdata
- the TLV structure to which objects are added
-
unsignedBigIntegerToByteArray
protected static byte[] unsignedBigIntegerToByteArray(java.math.BigInteger bi, int size)
Convert unsigned big integer into byte array, stripping of a leading 00 byte This conversion is required, because the Java BigInteger is a signed value, whereas the byte arrays containing key components are unsigned by default- Parameters:
bi
- BigInteger value to be convertedsize
- Number of bits- Returns:
- Byte array containing unsigned integer value
-
-