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


Java AlgorithmIdentifier.getParameters方法代碼示例

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


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

示例1: getSignatureName

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private static String getSignatureName(
    AlgorithmIdentifier sigAlgId)
{
    ASN1Encodable params = sigAlgId.getParameters();

    if (params != null && !DERNull.INSTANCE.equals(params))
    {
        if (sigAlgId.getAlgorithm().equals(PKCSObjectIdentifiers.id_RSASSA_PSS))
        {
            RSASSAPSSparams rsaParams = RSASSAPSSparams.getInstance(params);
            return getDigestAlgName(rsaParams.getHashAlgorithm().getAlgorithm()) + "WITHRSAANDMGF1";
        }
    }

    if (oids.containsKey(sigAlgId.getAlgorithm()))
    {
        return (String)oids.get(sigAlgId.getAlgorithm());
    }

    return sigAlgId.getAlgorithm().getId();
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:22,代碼來源:OperatorHelper.java

示例2: getSignatureName

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
static String getSignatureName(
    AlgorithmIdentifier sigAlgId) 
{
    ASN1Encodable params = sigAlgId.getParameters();
    
    if (params != null && !derNull.equals(params))
    {
        if (sigAlgId.getObjectId().equals(PKCSObjectIdentifiers.id_RSASSA_PSS))
        {
            RSASSAPSSparams rsaParams = RSASSAPSSparams.getInstance(params);
            
            return getDigestAlgName(rsaParams.getHashAlgorithm().getObjectId()) + "withRSAandMGF1";
        }
        if (sigAlgId.getObjectId().equals(X9ObjectIdentifiers.ecdsa_with_SHA2))
        {
            ASN1Sequence ecDsaParams = ASN1Sequence.getInstance(params);
            
            return getDigestAlgName((DERObjectIdentifier)ecDsaParams.getObjectAt(0)) + "withECDSA";
        }
    }

    return sigAlgId.getObjectId().getId();
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:X509SignatureUtil.java

示例3: getSignatureName

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
static String getSignatureName(
    AlgorithmIdentifier sigAlgId)
{
    ASN1Encodable params = sigAlgId.getParameters();

    if (params != null && !DERNull.INSTANCE.equals(params))
    {
        if (sigAlgId.getObjectId().equals(PKCSObjectIdentifiers.id_RSASSA_PSS))
        {
            RSASSAPSSparams rsaParams = RSASSAPSSparams.getInstance(params);
            return getDigestAlgName(rsaParams.getHashAlgorithm().getObjectId()) + "withRSAandMGF1";
        }
    }

    return sigAlgId.getObjectId().getId();
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:17,代碼來源:PKCS10CertificationRequest.java

示例4: getSignatureName

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
static String getSignatureName(
    AlgorithmIdentifier sigAlgId) 
{
    ASN1Encodable params = sigAlgId.getParameters();
    
    if (params != null && !derNull.equals(params))
    {
        if (sigAlgId.getAlgorithm().equals(PKCSObjectIdentifiers.id_RSASSA_PSS))
        {
            RSASSAPSSparams rsaParams = RSASSAPSSparams.getInstance(params);
            
            return getDigestAlgName(rsaParams.getHashAlgorithm().getAlgorithm()) + "withRSAandMGF1";
        }
        if (sigAlgId.getAlgorithm().equals(X9ObjectIdentifiers.ecdsa_with_SHA2))
        {
            ASN1Sequence ecDsaParams = ASN1Sequence.getInstance(params);
            
            return getDigestAlgName((DERObjectIdentifier)ecDsaParams.getObjectAt(0)) + "withECDSA";
        }
    }

    return sigAlgId.getAlgorithm().getId();
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:X509SignatureUtil.java

示例5: extractDigesetAlgFromSigAlg

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
public static AlgorithmIdentifier extractDigesetAlgFromSigAlg( AlgorithmIdentifier sigAlgId)
        throws NoSuchAlgorithmException {
    ASN1ObjectIdentifier algOid = sigAlgId.getAlgorithm();

    ASN1ObjectIdentifier digestAlgOid;
    if (PKCSObjectIdentifiers.id_RSASSA_PSS.equals(algOid)) {
        ASN1Encodable asn1Encodable = sigAlgId.getParameters();
        RSASSAPSSparams param = RSASSAPSSparams.getInstance(asn1Encodable);
        digestAlgOid = param.getHashAlgorithm().getAlgorithm();
    } else {
        HashAlgoType digestAlg = sigAlgOidToDigestMap.get(algOid);
        if (digestAlg == null) {
            throw new NoSuchAlgorithmException("unknown signature algorithm " + algOid.getId());
        }
        digestAlgOid = digestAlg.oid();
    }

    return new AlgorithmIdentifier(digestAlgOid, DERNull.INSTANCE);
}
 
開發者ID:xipki,項目名稱:xitk,代碼行數:20,代碼來源:AlgorithmUtil.java

示例6: isAlgIdEqual

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
static boolean isAlgIdEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2)
{
    if (!id1.getAlgorithm().equals(id2.getAlgorithm()))
    {
        return false;
    }

    if (id1.getParameters() == null)
    {
        if (id2.getParameters() != null && !id2.getParameters().equals(DERNull.INSTANCE))
        {
            return false;
        }

        return true;
    }

    if (id2.getParameters() == null)
    {
        if (id1.getParameters() != null && !id1.getParameters().equals(DERNull.INSTANCE))
        {
            return false;
        }

        return true;
    }

    return id1.getParameters().equals(id2.getParameters());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:30,代碼來源:CertUtils.java

示例7: isAlgIdEqual

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
private boolean isAlgIdEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2)
{
    if (!id1.getAlgorithm().equals(id2.getAlgorithm()))
    {
        return false;
    }

    if (id1.getParameters() == null)
    {
        if (id2.getParameters() != null && !id2.getParameters().equals(DERNull.INSTANCE))
        {
            return false;
        }

        return true;
    }

    if (id2.getParameters() == null)
    {
        if (id1.getParameters() != null && !id1.getParameters().equals(DERNull.INSTANCE))
        {
            return false;
        }

        return true;
    }
    
    return id1.getParameters().equals(id2.getParameters());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:30,代碼來源:X509CertificateObject.java

示例8: fixAlgID

import org.bouncycastle.asn1.x509.AlgorithmIdentifier; //導入方法依賴的package包/類
AlgorithmIdentifier fixAlgID(AlgorithmIdentifier algId)
{
    if (algId.getParameters() == null)
    {
        return new AlgorithmIdentifier(algId.getAlgorithm(), DERNull.INSTANCE);
    }

    return algId;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:10,代碼來源:CMSSignedHelper.java


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