本文整理汇总了Java中javacard.security.Signature.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Signature.getInstance方法的具体用法?Java Signature.getInstance怎么用?Java Signature.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javacard.security.Signature
的用法示例。
在下文中一共展示了Signature.getInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OpenPGPSecureMessaging
import javacard.security.Signature; //导入方法依赖的package包/类
/**
* Construct a new secure messaging wrapper.
*/
public OpenPGPSecureMessaging() {
ssc = JCSystem.makeTransientByteArray(SSC_SIZE,
JCSystem.CLEAR_ON_DESELECT);
tmp = JCSystem.makeTransientByteArray(TMP_SIZE,
JCSystem.CLEAR_ON_DESELECT);
signer = Signature.getInstance(
Signature.ALG_DES_MAC8_ISO9797_1_M2_ALG3, false);
verifier = Signature.getInstance(
Signature.ALG_DES_MAC8_ISO9797_1_M2_ALG3, false);
cipher = Cipher.getInstance(
Cipher.ALG_DES_CBC_ISO9797_M2, false);
decipher = Cipher.getInstance(
Cipher.ALG_DES_CBC_ISO9797_M2, false);
keyMAC = (DESKey) KeyBuilder.buildKey(
KeyBuilder.TYPE_DES_TRANSIENT_DESELECT,
KeyBuilder.LENGTH_DES3_2KEY, false);
keyENC = (DESKey) KeyBuilder.buildKey(
KeyBuilder.TYPE_DES_TRANSIENT_DESELECT,
KeyBuilder.LENGTH_DES3_2KEY, false);
ssc_set = JCSystem.makeTransientBooleanArray((short)1, JCSystem.CLEAR_ON_DESELECT);
ssc_set[0] = false;
}
示例2: ECPoint_Helper
import javacard.security.Signature; //导入方法依赖的package包/类
public ECPoint_Helper(ResourceManager rm) {
super(rm);
FLAG_FAST_EC_MULT_VIA_KA = false; // set true only if succesfully allocated and tested below
try {
//fnc_multiplication_x_keyAgreement = KeyAgreement.getInstance(KeyAgreement.ALG_EC_SVDP_DHC, false);
//fnc_SignVerifyECDSA_signEngine = Signature.getInstance(Signature.ALG_ECDSA_SHA, false);
//fnc_multiplication_x_keyAgreement = KeyAgreement.getInstance(Consts.KeyAgreement_ALG_EC_SVDP_DH_PLAIN_XY, false);
fnc_multiplication_x_keyAgreement = KeyAgreement.getInstance(KeyAgreement_ALG_EC_SVDP_DH_PLAIN, false);
fnc_SignVerifyECDSA_signEngine = Signature.getInstance(Signature_ALG_ECDSA_SHA_256, false);
FLAG_FAST_EC_MULT_VIA_KA = true;
} catch (Exception ignored) {
} // Discard any exception
}
示例3: CryptonitApplet
import javacard.security.Signature; //导入方法依赖的package包/类
protected CryptonitApplet(byte[] bArray, short bOffset, byte bLength) {
mgmt_key = KeyBuilder.buildKey(KeyBuilder.TYPE_DES,
KeyBuilder.LENGTH_DES3_3KEY, false);
((DESKey) mgmt_key).setKey(new byte[]{
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
}, (short) 0);
mgmt_counter = new OwnerPIN(MGMT_MAX_TRIES, (byte) 4);
mgmt_counter.update(new byte[]{0x00, 0x00, 0x00, 0x00}, (short) 0, (byte) 4);
challenge = JCSystem.makeTransientByteArray((short) 8,
JCSystem.CLEAR_ON_DESELECT);
pin = new OwnerPIN(PIN_MAX_TRIES, PIN_MAX_LENGTH);
pin.update(new byte[]{
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38
}, (short) 0, (byte) 8);
keys = new Key[(byte) 4];
random = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
authenticated = JCSystem.makeTransientBooleanArray((short) 1, JCSystem.CLEAR_ON_DESELECT);
rsa_cipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
try {
ec_signature = Signature.getInstance(Signature.ALG_ECDSA_SHA, false);
} catch (Exception e) {
}
FileIndex index = new FileIndex();
io = new IOBuffer(index);
register();
}
示例4: getSignature
import javacard.security.Signature; //导入方法依赖的package包/类
private Signature getSignature(byte key_nb, byte alg_id) {
if (signatures[key_nb] == null) {
try {
signatures[key_nb] = Signature.getInstance(alg_id, false);
} catch (Exception e) {
ISOException.throwIt(((CardRuntimeException) e).getReason());
}
} else if (signatures[key_nb].getAlgorithm() != alg_id)
ISOException.throwIt(SW_OPERATION_NOT_ALLOWED);
return signatures[key_nb];
}
示例5: SecureMessaging
import javacard.security.Signature; //导入方法依赖的package包/类
/**
* Constructor
*
* @param _tempBuffer a reference for Transient byte array buffer that is used for intermediate operations
*/
public SecureMessaging(byte[] _tempBuffer) {
tempBuffer = _tempBuffer;
mEncryptionKey = (AESKey) KeyBuilder.buildKey(
KeyBuilder.TYPE_AES_TRANSIENT_DESELECT,
KeyBuilder.LENGTH_AES_256, false);
mMackey_1 = (AESKey) KeyBuilder.buildKey(
KeyBuilder.TYPE_AES_TRANSIENT_DESELECT,
KeyBuilder.LENGTH_AES_128, false);
mMackey_2 = (AESKey) KeyBuilder.buildKey(
KeyBuilder.TYPE_AES_TRANSIENT_DESELECT,
KeyBuilder.LENGTH_AES_128, false);
// iv = new byte[(short)0x10];
mAESCipher = Cipher.getInstance(Cipher.ALG_AES_BLOCK_128_CBC_NOPAD,
false);
msgDigest_SHA256 = MessageDigest.getInstance(MessageDigest.ALG_SHA_256,
false);
mSignature = Signature.getInstance(Signature.ALG_AES_MAC_128_NOPAD,
false);
}
示例6: YkneoCurves
import javacard.security.Signature; //导入方法依赖的package包/类
public YkneoCurves() {
brainpoolp256r1 = BrainpoolP256r1.newKeyPair();
secp256r1 = SecP256r1.newKeyPair();
brainpoolp320r1 = BrainpoolP320r1.newKeyPair();
brainpoolp256t1 = BrainpoolP256t1.newKeyPair();
secp256k1 = SecP256k1.newKeyPair();
gost2001 = Gost2001.newKeyPair();
frp256v1 = Frp256v1.newKeyPair();
signature = Signature.getInstance(Signature.ALG_ECDSA_SHA, false);
}