当前位置: 首页>>代码示例>>Java>>正文


Java Signature.getInstance方法代码示例

本文整理汇总了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;
}
 
开发者ID:jderuiter,项目名称:javacard-openpgpcard,代码行数:28,代码来源:OpenPGPSecureMessaging.java

示例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        
}
 
开发者ID:OpenCryptoProject,项目名称:JCMathLib,代码行数:15,代码来源:ECPoint_Helper.java

示例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();
}
 
开发者ID:mbrossard,项目名称:cryptonit-applet,代码行数:32,代码来源:CryptonitApplet.java

示例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];
}
 
开发者ID:Toporin,项目名称:SatoChipApplet,代码行数:12,代码来源:CardEdge.java

示例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);

}
 
开发者ID:mobilesec,项目名称:secure-channel-ec-srp-applet,代码行数:33,代码来源:SecureMessaging.java

示例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);
}
 
开发者ID:Yubico,项目名称:ykneo-curves,代码行数:12,代码来源:YkneoCurves.java


注:本文中的javacard.security.Signature.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。