⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functions.java

📁 java 实现的签名方案
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
    }    if ((flags & PKCS11Constants.CKF_DIGEST) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_DIGEST");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_SIGN) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_SIGN");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_SIGN_RECOVER) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_SIGN_RECOVER");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_VERIFY) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_VERIFY");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_VERIFY_RECOVER) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_VERIFY_RECOVER");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_GENERATE) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_GENERATE");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_GENERATE_KEY_PAIR) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_GENERATE_KEY_PAIR");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_WRAP) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_WRAP");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_UNWRAP) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_UNWRAP");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_DERIVE) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_DERIVE");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_EC_F_P) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_EC_F_P");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_EC_F_2M) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_EC_F_2M");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_EC_ECPARAMETERS) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_EC_ECPARAMETERS");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_EC_NAMEDCURVE) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_EC_NAMEDCURVE");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_EC_UNCOMPRESS) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_EC_UNCOMPRESS");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_EC_COMPRESS) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_EC_COMPRESS");      notFirst = true;    }    if ((flags & PKCS11Constants.CKF_EXTENSION) != 0L) {      if (notFirst) {        buffer.append(" | ");      }      buffer.append("CKF_EXTENSION");      notFirst = true;    }    return buffer.toString();  }  /**   * Converts the long value code of a mechanism to a name.   *   * @param mechansimCode The code of the mechanism to be converted to a string.   * @return The string representation of the mechanism.   */  public static String mechanismCodeToString(long mechansimCode) {    if (mechansimNames_ == null) {      Hashtable mechansimNames = new Hashtable(160);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_PKCS_KEY_PAIR_GEN), PKCS11Constants.NAME_CKM_RSA_PKCS_KEY_PAIR_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_PKCS), PKCS11Constants.NAME_CKM_RSA_PKCS);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_9796), PKCS11Constants.NAME_CKM_RSA_9796);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_X_509), PKCS11Constants.NAME_CKM_RSA_X_509);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD2_RSA_PKCS), PKCS11Constants.NAME_CKM_MD2_RSA_PKCS);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD5_RSA_PKCS), PKCS11Constants.NAME_CKM_MD5_RSA_PKCS);      mechansimNames.put(new Long(PKCS11Constants.CKM_SHA1_RSA_PKCS), PKCS11Constants.NAME_CKM_SHA1_RSA_PKCS);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD128_RSA_PKCS), PKCS11Constants.NAME_CKM_RIPEMD128_RSA_PKCS);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD160_RSA_PKCS), PKCS11Constants.NAME_CKM_RIPEMD160_RSA_PKCS);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_PKCS_OAEP), PKCS11Constants.NAME_CKM_RSA_PKCS_OAEP);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_X9_31_KEY_PAIR_GEN), PKCS11Constants.NAME_CKM_RSA_X9_31_KEY_PAIR_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_X9_31), PKCS11Constants.NAME_CKM_RSA_X9_31);      mechansimNames.put(new Long(PKCS11Constants.CKM_SHA1_RSA_X9_31), PKCS11Constants.NAME_CKM_SHA1_RSA_X9_31);      mechansimNames.put(new Long(PKCS11Constants.CKM_RSA_PKCS_PSS), PKCS11Constants.NAME_CKM_RSA_PKCS_PSS);      mechansimNames.put(new Long(PKCS11Constants.CKM_SHA1_RSA_PKCS_PSS), PKCS11Constants.NAME_CKM_SHA1_RSA_PKCS_PSS);      mechansimNames.put(new Long(PKCS11Constants.CKM_DSA_KEY_PAIR_GEN), PKCS11Constants.NAME_CKM_DSA_KEY_PAIR_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_DSA), PKCS11Constants.NAME_CKM_DSA);      mechansimNames.put(new Long(PKCS11Constants.CKM_DSA_SHA1), PKCS11Constants.NAME_CKM_DSA_SHA1);      mechansimNames.put(new Long(PKCS11Constants.CKM_DH_PKCS_KEY_PAIR_GEN), PKCS11Constants.NAME_CKM_DH_PKCS_KEY_PAIR_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_DH_PKCS_DERIVE), PKCS11Constants.NAME_CKM_DH_PKCS_DERIVE);      mechansimNames.put(new Long(PKCS11Constants.CKM_X9_42_DH_KEY_PAIR_GEN), PKCS11Constants.NAME_CKM_X9_42_DH_KEY_PAIR_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_X9_42_DH_DERIVE), PKCS11Constants.NAME_CKM_X9_42_DH_DERIVE);      mechansimNames.put(new Long(PKCS11Constants.CKM_X9_42_DH_HYBRID_DERIVE), PKCS11Constants.NAME_CKM_X9_42_DH_HYBRID_DERIVE);      mechansimNames.put(new Long(PKCS11Constants.CKM_X9_42_MQV_DERIVE), PKCS11Constants.NAME_CKM_X9_42_MQV_DERIVE);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC2_KEY_GEN), PKCS11Constants.NAME_CKM_RC2_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC2_ECB), PKCS11Constants.NAME_CKM_RC2_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC2_CBC), PKCS11Constants.NAME_CKM_RC2_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC2_MAC), PKCS11Constants.NAME_CKM_RC2_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC2_MAC_GENERAL), PKCS11Constants.NAME_CKM_RC2_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC2_CBC_PAD), PKCS11Constants.NAME_CKM_RC2_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC4_KEY_GEN), PKCS11Constants.NAME_CKM_RC4_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC4), PKCS11Constants.NAME_CKM_RC4);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES_KEY_GEN), PKCS11Constants.NAME_CKM_DES_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES_ECB), PKCS11Constants.NAME_CKM_DES_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES_CBC), PKCS11Constants.NAME_CKM_DES_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES_MAC), PKCS11Constants.NAME_CKM_DES_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES_MAC_GENERAL), PKCS11Constants.NAME_CKM_DES_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES_CBC_PAD), PKCS11Constants.NAME_CKM_DES_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES2_KEY_GEN), PKCS11Constants.NAME_CKM_DES2_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES3_KEY_GEN), PKCS11Constants.NAME_CKM_DES3_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES3_ECB), PKCS11Constants.NAME_CKM_DES3_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES3_CBC), PKCS11Constants.NAME_CKM_DES3_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES3_MAC), PKCS11Constants.NAME_CKM_DES3_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES3_MAC_GENERAL), PKCS11Constants.NAME_CKM_DES3_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_DES3_CBC_PAD), PKCS11Constants.NAME_CKM_DES3_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_CDMF_KEY_GEN), PKCS11Constants.NAME_CKM_CDMF_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_CDMF_ECB), PKCS11Constants.NAME_CKM_CDMF_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_CDMF_CBC), PKCS11Constants.NAME_CKM_CDMF_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CDMF_MAC), PKCS11Constants.NAME_CKM_CDMF_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CDMF_MAC_GENERAL), PKCS11Constants.NAME_CKM_CDMF_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_CDMF_CBC_PAD), PKCS11Constants.NAME_CKM_CDMF_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD2), PKCS11Constants.NAME_CKM_MD2);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD2_HMAC), PKCS11Constants.NAME_CKM_MD2_HMAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD2_HMAC_GENERAL), PKCS11Constants.NAME_CKM_MD2_HMAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD5), PKCS11Constants.NAME_CKM_MD5);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD5_HMAC), PKCS11Constants.NAME_CKM_MD5_HMAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_MD5_HMAC_GENERAL), PKCS11Constants.NAME_CKM_MD5_HMAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_SHA_1), PKCS11Constants.NAME_CKM_SHA_1);      mechansimNames.put(new Long(PKCS11Constants.CKM_SHA_1_HMAC), PKCS11Constants.NAME_CKM_SHA_1_HMAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_SHA_1_HMAC_GENERAL), PKCS11Constants.NAME_CKM_SHA_1_HMAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD128), PKCS11Constants.NAME_CKM_RIPEMD128);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD128_HMAC), PKCS11Constants.NAME_CKM_RIPEMD128_HMAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD128_HMAC_GENERAL), PKCS11Constants.NAME_CKM_RIPEMD128_HMAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD160), PKCS11Constants.NAME_CKM_RIPEMD160);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD160_HMAC), PKCS11Constants.NAME_CKM_RIPEMD160_HMAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_RIPEMD160_HMAC_GENERAL), PKCS11Constants.NAME_CKM_RIPEMD160_HMAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST_KEY_GEN), PKCS11Constants.NAME_CKM_CAST_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST_ECB), PKCS11Constants.NAME_CKM_CAST_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST_CBC), PKCS11Constants.NAME_CKM_CAST_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST_MAC), PKCS11Constants.NAME_CKM_CAST_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST_MAC_GENERAL), PKCS11Constants.NAME_CKM_CAST_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST_CBC_PAD), PKCS11Constants.NAME_CKM_CAST_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST3_KEY_GEN), PKCS11Constants.NAME_CKM_CAST3_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST3_ECB), PKCS11Constants.NAME_CKM_CAST3_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST3_CBC), PKCS11Constants.NAME_CKM_CAST3_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST3_MAC), PKCS11Constants.NAME_CKM_CAST3_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST3_MAC_GENERAL), PKCS11Constants.NAME_CKM_CAST3_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST3_CBC_PAD), PKCS11Constants.NAME_CKM_CAST3_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST5_KEY_GEN), PKCS11Constants.NAME_CKM_CAST5_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST128_KEY_GEN), PKCS11Constants.NAME_CKM_CAST128_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST5_ECB), PKCS11Constants.NAME_CKM_CAST5_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST128_ECB), PKCS11Constants.NAME_CKM_CAST128_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST5_CBC), PKCS11Constants.NAME_CKM_CAST5_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST128_CBC), PKCS11Constants.NAME_CKM_CAST128_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST5_MAC), PKCS11Constants.NAME_CKM_CAST5_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST128_MAC), PKCS11Constants.NAME_CKM_CAST128_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST5_MAC_GENERAL), PKCS11Constants.NAME_CKM_CAST5_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST128_MAC_GENERAL), PKCS11Constants.NAME_CKM_CAST128_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST5_CBC_PAD), PKCS11Constants.NAME_CKM_CAST5_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_CAST128_CBC_PAD), PKCS11Constants.NAME_CKM_CAST128_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC5_KEY_GEN), PKCS11Constants.NAME_CKM_RC5_KEY_GEN);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC5_ECB), PKCS11Constants.NAME_CKM_RC5_ECB);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC5_CBC), PKCS11Constants.NAME_CKM_RC5_CBC);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC5_MAC), PKCS11Constants.NAME_CKM_RC5_MAC);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC5_MAC_GENERAL), PKCS11Constants.NAME_CKM_RC5_MAC_GENERAL);      mechansimNames.put(new Long(PKCS11Constants.CKM_RC5_CBC_PAD), PKCS11Constants.NAME_CKM_RC5_CBC_PAD);      mechansimNames.put(new Long(PKCS11Constants.CKM_IDEA_KEY_GEN), PKCS11Constants.NAME_CKM_IDEA_KEY_GEN);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -