本文整理汇总了Java中org.bouncycastle.asn1.x509.GeneralName.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java GeneralName.getInstance方法的具体用法?Java GeneralName.getInstance怎么用?Java GeneralName.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.x509.GeneralName
的用法示例。
在下文中一共展示了GeneralName.getInstance方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EncKeyWithID
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private EncKeyWithID(ASN1Sequence seq)
{
this.privKeyInfo = PrivateKeyInfo.getInstance(seq.getObjectAt(0));
if (seq.size() > 1)
{
if (!(seq.getObjectAt(1) instanceof DERUTF8String))
{
this.identifier = GeneralName.getInstance(seq.getObjectAt(1));
}
else
{
this.identifier = (ASN1Encodable)seq.getObjectAt(1);
}
}
else
{
this.identifier = null;
}
}
示例2: POPOSigningKeyInput
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private POPOSigningKeyInput(ASN1Sequence seq)
{
ASN1Encodable authInfo = (ASN1Encodable)seq.getObjectAt(0);
if (authInfo instanceof ASN1TaggedObject)
{
ASN1TaggedObject tagObj = (ASN1TaggedObject)authInfo;
if (tagObj.getTagNo() != 0)
{
throw new IllegalArgumentException(
"Unknown authInfo tag: " + tagObj.getTagNo());
}
sender = GeneralName.getInstance(tagObj.getObject());
}
else
{
publicKeyMAC = PKMACValue.getInstance(authInfo);
}
publicKey = SubjectPublicKeyInfo.getInstance(seq.getObjectAt(1));
}
示例3: SemanticsInformation
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private SemanticsInformation(ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
if (seq.size() < 1)
{
throw new IllegalArgumentException("no objects in SemanticsInformation");
}
Object object = e.nextElement();
if (object instanceof ASN1ObjectIdentifier)
{
semanticsIdentifier = ASN1ObjectIdentifier.getInstance(object);
if (e.hasMoreElements())
{
object = e.nextElement();
}
else
{
object = null;
}
}
if (object != null)
{
ASN1Sequence generalNameSeq = ASN1Sequence.getInstance(object);
nameRegistrationAuthorities = new GeneralName[generalNameSeq.size()];
for (int i= 0; i < generalNameSeq.size(); i++)
{
nameRegistrationAuthorities[i] = GeneralName.getInstance(generalNameSeq.getObjectAt(i));
}
}
}
示例4: ProcurationSyntax
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
/**
* Constructor from ASN1Sequence.
* <p/>
* The sequence is of type ProcurationSyntax:
* <p/>
* <pre>
* ProcurationSyntax ::= SEQUENCE {
* country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
* typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
* signingFor [3] EXPLICIT SigningFor
* }
* <p/>
* SigningFor ::= CHOICE
* {
* thirdPerson GeneralName,
* certRef IssuerSerial
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private ProcurationSyntax(ASN1Sequence seq)
{
if (seq.size() < 1 || seq.size() > 3)
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
switch (o.getTagNo())
{
case 1:
country = DERPrintableString.getInstance(o, true).getString();
break;
case 2:
typeOfSubstitution = DirectoryString.getInstance(o, true);
break;
case 3:
ASN1Encodable signingFor = o.getObject();
if (signingFor instanceof ASN1TaggedObject)
{
thirdPerson = GeneralName.getInstance(signingFor);
}
else
{
certRef = IssuerSerial.getInstance(signingFor);
}
break;
default:
throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
}
}
}
示例5: SinglePubInfo
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private SinglePubInfo(ASN1Sequence seq)
{
pubMethod = ASN1Integer.getInstance(seq.getObjectAt(0));
if (seq.size() == 2)
{
pubLocation = GeneralName.getInstance(seq.getObjectAt(1));
}
}
示例6: DVCSErrorNotice
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private DVCSErrorNotice(ASN1Sequence seq)
{
this.transactionStatus = PKIStatusInfo.getInstance(seq.getObjectAt(0));
if (seq.size() > 1)
{
this.transactionIdentifier = GeneralName.getInstance(seq.getObjectAt(1));
}
}
示例7: DVCSRequest
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private DVCSRequest(ASN1Sequence seq)
{
requestInformation = DVCSRequestInformation.getInstance(seq.getObjectAt(0));
data = Data.getInstance(seq.getObjectAt(1));
if (seq.size() > 2)
{
transactionIdentifier = GeneralName.getInstance(seq.getObjectAt(2));
}
}
示例8: TBSRequest
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private TBSRequest(
ASN1Sequence seq)
{
int index = 0;
if (seq.getObjectAt(0) instanceof ASN1TaggedObject)
{
ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(0);
if (o.getTagNo() == 0)
{
versionSet = true;
version = ASN1Integer.getInstance((ASN1TaggedObject)seq.getObjectAt(0), true);
index++;
}
else
{
version = V1;
}
}
else
{
version = V1;
}
if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
{
requestorName = GeneralName.getInstance((ASN1TaggedObject)seq.getObjectAt(index++), true);
}
requestList = (ASN1Sequence)seq.getObjectAt(index++);
if (seq.size() == (index + 1))
{
requestExtensions = Extensions.getInstance((ASN1TaggedObject)seq.getObjectAt(index), true);
}
}
示例9: getAlternativeNames
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private static Collection getAlternativeNames(byte[] extVal)
throws CertificateParsingException
{
if (extVal == null)
{
return Collections.EMPTY_LIST;
}
try
{
Collection temp = new ArrayList();
Enumeration it = DERSequence.getInstance(fromExtensionValue(extVal)).getObjects();
while (it.hasMoreElements())
{
GeneralName genName = GeneralName.getInstance(it.nextElement());
List list = new ArrayList();
list.add(Integers.valueOf(genName.getTagNo()));
switch (genName.getTagNo())
{
case GeneralName.ediPartyName:
case GeneralName.x400Address:
case GeneralName.otherName:
list.add(genName.getName().toASN1Primitive());
break;
case GeneralName.directoryName:
list.add(X500Name.getInstance(genName.getName()).toString());
break;
case GeneralName.dNSName:
case GeneralName.rfc822Name:
case GeneralName.uniformResourceIdentifier:
list.add(((ASN1String)genName.getName()).getString());
break;
case GeneralName.registeredID:
list.add(ASN1ObjectIdentifier.getInstance(genName.getName()).getId());
break;
case GeneralName.iPAddress:
list.add(DEROctetString.getInstance(genName.getName()).getOctets());
break;
default:
throw new IOException("Bad tag number: " + genName.getTagNo());
}
temp.add(list);
}
return Collections.unmodifiableCollection(temp);
}
catch (Exception e)
{
throw new CertificateParsingException(e.getMessage());
}
}
示例10: getRequestorName
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
public GeneralName getRequestorName()
{
return GeneralName.getInstance(req.getTbsRequest().getRequestorName());
}
示例11: AdmissionSyntax
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
/**
* Constructor from ASN1Sequence.
* <p/>
* The sequence is of type ProcurationSyntax:
* <p/>
* <pre>
* AdmissionSyntax ::= SEQUENCE
* {
* admissionAuthority GeneralName OPTIONAL,
* contentsOfAdmissions SEQUENCE OF Admissions
* }
* <p/>
* Admissions ::= SEQUENCE
* {
* admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
* namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
* professionInfos SEQUENCE OF ProfessionInfo
* }
* <p/>
* NamingAuthority ::= SEQUENCE
* {
* namingAuthorityId OBJECT IDENTIFIER OPTIONAL,
* namingAuthorityUrl IA5String OPTIONAL,
* namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
* }
* <p/>
* ProfessionInfo ::= SEQUENCE
* {
* namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
* professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
* professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
* registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
* addProfessionInfo OCTET STRING OPTIONAL
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private AdmissionSyntax(ASN1Sequence seq)
{
switch (seq.size())
{
case 1:
contentsOfAdmissions = DERSequence.getInstance(seq.getObjectAt(0));
break;
case 2:
admissionAuthority = GeneralName.getInstance(seq.getObjectAt(0));
contentsOfAdmissions = DERSequence.getInstance(seq.getObjectAt(1));
break;
default:
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
}
示例12: CertId
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private CertId(ASN1Sequence seq)
{
issuer = GeneralName.getInstance(seq.getObjectAt(0));
serialNumber = ASN1Integer.getInstance(seq.getObjectAt(1));
}
示例13: TSTInfo
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private TSTInfo(ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
// version
version = ASN1Integer.getInstance(e.nextElement());
// tsaPolicy
tsaPolicyId = ASN1ObjectIdentifier.getInstance(e.nextElement());
// messageImprint
messageImprint = MessageImprint.getInstance(e.nextElement());
// serialNumber
serialNumber = ASN1Integer.getInstance(e.nextElement());
// genTime
genTime = ASN1GeneralizedTime.getInstance(e.nextElement());
// default for ordering
ordering = ASN1Boolean.getInstance(false);
while (e.hasMoreElements())
{
ASN1Object o = (ASN1Object) e.nextElement();
if (o instanceof ASN1TaggedObject)
{
DERTaggedObject tagged = (DERTaggedObject) o;
switch (tagged.getTagNo())
{
case 0:
tsa = GeneralName.getInstance(tagged, true);
break;
case 1:
extensions = Extensions.getInstance(tagged, false);
break;
default:
throw new IllegalArgumentException("Unknown tag value " + tagged.getTagNo());
}
}
else if (o instanceof ASN1Sequence || o instanceof Accuracy)
{
accuracy = Accuracy.getInstance(o);
}
else if (o instanceof ASN1Boolean)
{
ordering = ASN1Boolean.getInstance(o);
}
else if (o instanceof ASN1Integer)
{
nonce = ASN1Integer.getInstance(o);
}
}
}
示例14: PKIHeader
import org.bouncycastle.asn1.x509.GeneralName; //导入方法依赖的package包/类
private PKIHeader(ASN1Sequence seq)
{
Enumeration en = seq.getObjects();
pvno = ASN1Integer.getInstance(en.nextElement());
sender = GeneralName.getInstance(en.nextElement());
recipient = GeneralName.getInstance(en.nextElement());
while (en.hasMoreElements())
{
ASN1TaggedObject tObj = (ASN1TaggedObject)en.nextElement();
switch (tObj.getTagNo())
{
case 0:
messageTime = DERGeneralizedTime.getInstance(tObj, true);
break;
case 1:
protectionAlg = AlgorithmIdentifier.getInstance(tObj, true);
break;
case 2:
senderKID = ASN1OctetString.getInstance(tObj, true);
break;
case 3:
recipKID = ASN1OctetString.getInstance(tObj, true);
break;
case 4:
transactionID = ASN1OctetString.getInstance(tObj, true);
break;
case 5:
senderNonce = ASN1OctetString.getInstance(tObj, true);
break;
case 6:
recipNonce = ASN1OctetString.getInstance(tObj, true);
break;
case 7:
freeText = PKIFreeText.getInstance(tObj, true);
break;
case 8:
generalInfo = ASN1Sequence.getInstance(tObj, true);
break;
default:
throw new IllegalArgumentException("unknown tag number: " + tObj.getTagNo());
}
}
}