本文整理汇总了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());
}
}
示例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());
}
}
示例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;
}
示例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.");
}
}
示例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;
}
示例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);
}
示例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));
}
}
示例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;
}
}
示例9: JcaPKIArchiveControlBuilder
import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public JcaPKIArchiveControlBuilder(PrivateKey privateKey, X500Principal name)
{
this(privateKey, X500Name.getInstance(name.getEncoded()));
}
示例10: getIssuer
import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public static X500Name getIssuer(X509Certificate certificate)
{
return X500Name.getInstance(certificate.getIssuerX500Principal().getEncoded());
}
示例11: getSubjectDN
import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public Principal getSubjectDN()
{
return new X509Principal(X500Name.getInstance(c.getSubject().toASN1Primitive()));
}
示例12: getSubject
import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public static X500Name getSubject(X500NameStyle style, X509Certificate certificate)
{
return X500Name.getInstance(style, certificate.getSubjectX500Principal().getEncoded());
}
示例13: setSubject
import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
/**
* @deprecated use X500Name method
*/
public void setSubject(
X509Name subject)
{
this.subject = X500Name.getInstance(subject.toASN1Primitive());
}
示例14: getIssuerDN
import org.bouncycastle.asn1.x500.X500Name; //导入方法依赖的package包/类
public Principal getIssuerDN()
{
return new X509Principal(X500Name.getInstance(c.getIssuer().toASN1Primitive()));
}
示例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());
}