當前位置: 首頁>>代碼示例>>Java>>正文


Java SignatureMethod.RSA_SHA1屬性代碼示例

本文整理匯總了Java中javax.xml.crypto.dsig.SignatureMethod.RSA_SHA1屬性的典型用法代碼示例。如果您正苦於以下問題:Java SignatureMethod.RSA_SHA1屬性的具體用法?Java SignatureMethod.RSA_SHA1怎麽用?Java SignatureMethod.RSA_SHA1使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.xml.crypto.dsig.SignatureMethod的用法示例。


在下文中一共展示了SignatureMethod.RSA_SHA1屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fromAlg

private String fromAlg ( final String alg )
{
    if ( "DSA".equals ( alg ) )
    {
        return SignatureMethod.DSA_SHA1;
    }
    else if ( "RSA".equals ( alg ) )
    {
        return SignatureMethod.RSA_SHA1;
    }
    else if ( "HMAC".equals ( alg ) )
    {
        return SignatureMethod.HMAC_SHA1;
    }
    else
    {
        throw new IllegalArgumentException ( String.format ( "Key algorithm '%s' is not supported", alg ) );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:19,代碼來源:RequestSigner.java

示例2: getSignatureMethod

private String getSignatureMethod(DigestAlgo digestAlgo) {
	if (null == digestAlgo) {
		throw new RuntimeException("digest algo is null");
	}

	switch (digestAlgo) {

	case SHA1:
		return SignatureMethod.RSA_SHA1;
	case SHA256:
		return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256;
	case SHA512:
		return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512;
	}

	// TODO: complete me
	// if ("SHA-384".equals(digestAlgo)) {
	// return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384;
	// }
	// if ("RIPEMD160".equals(digestAlgo)) {
	// return XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160;
	// }
	throw new RuntimeException("unsupported sign algo: " + digestAlgo);
}
 
開發者ID:e-Contract,項目名稱:eid-applet,代碼行數:24,代碼來源:AbstractXmlSignatureService.java

示例3: getSignatureMethod

private String getSignatureMethod(String digestAlgo) {
	if (null == digestAlgo) {
		throw new RuntimeException("digest algo is null");
	}
	if ("SHA-1".equals(digestAlgo)) {
		return SignatureMethod.RSA_SHA1;
	}
	if ("SHA-256".equals(digestAlgo)) {
		return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256;
	}
	if ("SHA-512".equals(digestAlgo)) {
		return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512;
	}
	if ("SHA-384".equals(digestAlgo)) {
		return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384;
	}
	if ("RIPEMD160".equals(digestAlgo)) {
		return XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160;
	}
	throw new RuntimeException("unsupported sign algo: " + digestAlgo);
}
 
開發者ID:e-Contract,項目名稱:eid-applet,代碼行數:21,代碼來源:XmlSignatureServiceBean.java

示例4: initSignedInfo

private SignedInfo initSignedInfo(XMLSignatureFactory fac) throws Exception {
        Reference ref = initReference(fac);
        String cm = null;
        cm = map.getProperty(CANONICALIZATIONMETHOD);
        String sigmethod = null;
        sigmethod = map.getProperty(SIGNATURE_METHOD);
        if (sigmethod == null) {
                sigmethod = SignatureMethod.RSA_SHA1;
        }
        if (cm == null) {
                cm = CanonicalizationMethod.EXCLUSIVE;
        }
        SignedInfo si = fac.newSignedInfo(fac.newCanonicalizationMethod(
                cm,
                (C14NMethodParameterSpec) null),
                fac.newSignatureMethod(sigmethod,
                        null), Collections.singletonList(ref));
        return si;
}
 
開發者ID:apache,項目名稱:juddi,代碼行數:19,代碼來源:DigSigUtil.java


注:本文中的javax.xml.crypto.dsig.SignatureMethod.RSA_SHA1屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。