當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。