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


Java X500Name.getInstance方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.x500.X500Name.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java X500Name.getInstance方法的具体用法?Java X500Name.getInstance怎么用?Java X500Name.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.x500.X500Name的用法示例。


在下文中一共展示了X500Name.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCertificateHolderSelector

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public X509CertificateHolderSelector getCertificateHolderSelector(X509CertSelector certSelector)
{
    try
    {
        if (certSelector.getSubjectKeyIdentifier() != null)
        {
            return new X509CertificateHolderSelector(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber(), ASN1OctetString.getInstance(certSelector.getSubjectKeyIdentifier()).getOctets());
        }
        else
        {
            return new X509CertificateHolderSelector(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber());
        }
    }
    catch (IOException e)
    {
        throw new IllegalArgumentException("unable to convert issuer: " + e.getMessage());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:JcaSelectorConverter.java

示例2: getSignerId

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public SignerId getSignerId(X509CertSelector certSelector)
{
    try
    {
        if (certSelector.getSubjectKeyIdentifier() != null)
        {
            return new SignerId(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber(), ASN1OctetString.getInstance(certSelector.getSubjectKeyIdentifier()).getOctets());
        }
        else
        {
            return new SignerId(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber());
        }
    }
    catch (IOException e)
    {
        throw new IllegalArgumentException("unable to convert issuer: " + e.getMessage());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:JcaSelectorConverter.java

示例3: loadCRLEntries

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
private Set loadCRLEntries()
{
    Set entrySet = new HashSet();
    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name previousCertificateIssuer = null; // the issuer
    while (certs.hasMoreElements())
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)certs.nextElement();
        X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer);
        entrySet.add(crlEntry);
        if (isIndirect && entry.hasExtensions())
        {
            Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

            if (currentCaName != null)
            {
                previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
            }
        }
    }

    return entrySet;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:X509CRLObject.java

示例4: CertificationRequestInfo

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
/**
 * @deprecated use X500Name method.
 */
public CertificationRequestInfo(
    X509Name                subject,
    SubjectPublicKeyInfo    pkInfo,
    ASN1Set                 attributes)
{
    this.subject = X500Name.getInstance(subject.toASN1Primitive());
    this.subjectPKInfo = pkInfo;
    this.attributes = attributes;

    if ((subject == null) || (version == null) || (subjectPKInfo == null))
    {
        throw new IllegalArgumentException("Not all mandatory fields set in CertificationRequestInfo generator.");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:CertificationRequestInfo.java

示例5: GeneralName

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
/**
 * @deprecated use X500Name constructor.
 * @param dirName
 */
    public GeneralName(
    X509Name  dirName)
{
    this.obj = X500Name.getInstance(dirName);
    this.tag = 4;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:GeneralName.java

示例6: IssuerAndSerialNumber

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public IssuerAndSerialNumber(
    X509Name    name,
    BigInteger  certSerialNumber)
{
    this.name = X500Name.getInstance(name.toASN1Primitive());
    this.certSerialNumber = new ASN1Integer(certSerialNumber);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:8,代码来源:IssuerAndSerialNumber.java

示例7: CrlIdentifier

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
private CrlIdentifier(ASN1Sequence seq)
{
    if (seq.size() < 2 || seq.size() > 3)
    {
        throw new IllegalArgumentException();
    }
    this.crlIssuer = X500Name.getInstance(seq.getObjectAt(0));
    this.crlIssuedTime = ASN1UTCTime.getInstance(seq.getObjectAt(1));
    if (seq.size() > 2)
    {
        this.crlNumber = ASN1Integer.getInstance(seq.getObjectAt(2));
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:CrlIdentifier.java

示例8: getIssuerDN

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public Principal getIssuerDN()
{
    try
    {
        return new X509Principal(X500Name.getInstance(c.getIssuer().getEncoded()));
    }
    catch (IOException e)
    {
        return null;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:12,代码来源:X509CertificateObject.java

示例9: JcaPKIArchiveControlBuilder

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public JcaPKIArchiveControlBuilder(PrivateKey privateKey, X500Principal name)
{
    this(privateKey, X500Name.getInstance(name.getEncoded()));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:JcaPKIArchiveControlBuilder.java

示例10: getIssuer

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public static X500Name getIssuer(X509Certificate certificate)
{
    return X500Name.getInstance(certificate.getIssuerX500Principal().getEncoded());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:JcaX500NameUtil.java

示例11: getSubjectDN

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public Principal getSubjectDN()
{
    return new X509Principal(X500Name.getInstance(c.getSubject().toASN1Primitive()));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:X509CertificateObject.java

示例12: getSubject

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public static X500Name getSubject(X500NameStyle style, X509Certificate certificate)
{
    return X500Name.getInstance(style, certificate.getSubjectX500Principal().getEncoded());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:JcaX500NameUtil.java

示例13: setSubject

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
/**
 * @deprecated use X500Name method
 */
public void setSubject(
    X509Name    subject)
{
    this.subject = X500Name.getInstance(subject.toASN1Primitive());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:9,代码来源:V1TBSCertificateGenerator.java

示例14: getIssuerDN

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public Principal getIssuerDN()
{
    return new X509Principal(X500Name.getInstance(c.getIssuer().toASN1Primitive()));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:X509CRLObject.java

示例15: getInstance

import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public static GeneralName getInstance(
    Object obj)
{
    if (obj == null || obj instanceof GeneralName)
    {
        return (GeneralName)obj;
    }

    if (obj instanceof ASN1TaggedObject)
    {
        ASN1TaggedObject    tagObj = (ASN1TaggedObject)obj;
        int                 tag = tagObj.getTagNo();

        switch (tag)
        {
        case otherName:
            return new GeneralName(tag, ASN1Sequence.getInstance(tagObj, false));
        case rfc822Name:
            return new GeneralName(tag, DERIA5String.getInstance(tagObj, false));
        case dNSName:
            return new GeneralName(tag, DERIA5String.getInstance(tagObj, false));
        case x400Address:
            throw new IllegalArgumentException("unknown tag: " + tag);
        case directoryName:
            return new GeneralName(tag, X500Name.getInstance(tagObj, true));
        case ediPartyName:
            return new GeneralName(tag, ASN1Sequence.getInstance(tagObj, false));
        case uniformResourceIdentifier:
            return new GeneralName(tag, DERIA5String.getInstance(tagObj, false));
        case iPAddress:
            return new GeneralName(tag, ASN1OctetString.getInstance(tagObj, false));
        case registeredID:
            return new GeneralName(tag, ASN1ObjectIdentifier.getInstance(tagObj, false));
        }
    }

    if (obj instanceof byte[])
    {
        try
        {
            return getInstance(ASN1Primitive.fromByteArray((byte[])obj));
        }
        catch (IOException e)
        {
            throw new IllegalArgumentException("unable to parse encoded general name");
        }
    }

    throw new IllegalArgumentException("unknown object in getInstance: " + obj.getClass().getName());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:51,代码来源:GeneralName.java


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