当前位置: 首页>>代码示例>>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;未经允许,请勿转载。