本文整理汇总了Java中org.bouncycastle.asn1.ASN1Sequence.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ASN1Sequence.getInstance方法的具体用法?Java ASN1Sequence.getInstance怎么用?Java ASN1Sequence.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.ASN1Sequence
的用法示例。
在下文中一共展示了ASN1Sequence.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSignatureName
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的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();
}
示例2: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
* return a OtherRecipientInfo object from the given object.
*
* @param obj the object we want converted.
* @exception IllegalArgumentException if the object cannot be converted.
*/
public static OtherRecipientInfo getInstance(
Object obj)
{
if (obj instanceof OtherRecipientInfo)
{
return (OtherRecipientInfo)obj;
}
if (obj != null)
{
return new OtherRecipientInfo(ASN1Sequence.getInstance(obj));
}
return null;
}
示例3: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static Data getInstance(Object obj)
{
if (obj instanceof Data)
{
return (Data)obj;
}
else if (obj instanceof ASN1OctetString)
{
return new Data((ASN1OctetString)obj);
}
else if (obj instanceof ASN1Sequence)
{
return new Data(DigestInfo.getInstance(obj));
}
else if (obj instanceof ASN1TaggedObject)
{
return new Data(ASN1Sequence.getInstance((ASN1TaggedObject)obj, false));
}
throw new IllegalArgumentException("Unknown object submitted to getInstance: " + obj.getClass().getName());
}
示例4: SignerLocation
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public SignerLocation(
DERUTF8String countryName,
DERUTF8String localityName,
ASN1Sequence postalAddress)
{
if (postalAddress != null && postalAddress.size() > 6)
{
throw new IllegalArgumentException("postal address must contain less than 6 strings");
}
if (countryName != null)
{
this.countryName = DERUTF8String.getInstance(countryName.toASN1Primitive());
}
if (localityName != null)
{
this.localityName = DERUTF8String.getInstance(localityName.toASN1Primitive());
}
if (postalAddress != null)
{
this.postalAddress = ASN1Sequence.getInstance(postalAddress.toASN1Primitive());
}
}
示例5: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static SafeBag getInstance(
Object obj)
{
if (obj instanceof SafeBag)
{
return (SafeBag)obj;
}
if (obj != null)
{
return new SafeBag(ASN1Sequence.getInstance(obj));
}
return null;
}
示例6: intersectDN
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private Set intersectDN(Set permitted, Set dns)
{
Set intersect = new HashSet();
for (Iterator it = dns.iterator(); it.hasNext();)
{
ASN1Sequence dn = ASN1Sequence.getInstance(((GeneralSubtree)it
.next()).getBase().getName().toASN1Primitive());
if (permitted == null)
{
if (dn != null)
{
intersect.add(dn);
}
}
else
{
Iterator _iter = permitted.iterator();
while (_iter.hasNext())
{
ASN1Sequence subtree = (ASN1Sequence)_iter.next();
if (withinDNSubtree(dn, subtree))
{
intersect.add(dn);
}
else if (withinDNSubtree(subtree, dn))
{
intersect.add(subtree);
}
}
}
}
return intersect;
}
示例7: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static RevAnnContent getInstance(Object o)
{
if (o instanceof RevAnnContent)
{
return (RevAnnContent)o;
}
if (o != null)
{
return new RevAnnContent(ASN1Sequence.getInstance(o));
}
return null;
}
示例8: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static PKMACValue getInstance(Object o)
{
if (o instanceof PKMACValue)
{
return (PKMACValue)o;
}
if (o != null)
{
return new PKMACValue(ASN1Sequence.getInstance(o));
}
return null;
}
示例9: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static AuthorityInformationAccess getInstance(
Object obj)
{
if (obj instanceof AuthorityInformationAccess)
{
return (AuthorityInformationAccess)obj;
}
if (obj != null)
{
return new AuthorityInformationAccess(ASN1Sequence.getInstance(obj));
}
return null;
}
示例10: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static McElieceCCA2PrivateKey getInstance(Object o)
{
if (o instanceof McElieceCCA2PrivateKey)
{
return (McElieceCCA2PrivateKey)o;
}
else if (o != null)
{
return new McElieceCCA2PrivateKey(ASN1Sequence.getInstance(o));
}
return null;
}
示例11: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static MacData getInstance(
Object obj)
{
if (obj instanceof MacData)
{
return (MacData)obj;
}
else if (obj != null)
{
return new MacData(ASN1Sequence.getInstance(obj));
}
return null;
}
示例12: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
* Creates an instance of a TargetInformation from the given object.
* <p>
* <code>obj</code> can be a TargetInformation or a {@link ASN1Sequence}
*
* @param obj The object.
* @return A TargetInformation instance.
* @throws IllegalArgumentException if the given object cannot be
* interpreted as TargetInformation.
*/
public static TargetInformation getInstance(Object obj)
{
if (obj instanceof TargetInformation)
{
return (TargetInformation)obj;
}
else if (obj != null)
{
return new TargetInformation(ASN1Sequence.getInstance(obj));
}
return null;
}
示例13: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static CommitmentTypeIndication getInstance(
Object obj)
{
if (obj == null || obj instanceof CommitmentTypeIndication)
{
return (CommitmentTypeIndication)obj;
}
return new CommitmentTypeIndication(ASN1Sequence.getInstance(obj));
}
示例14: getInstance
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public static NoticeReference getInstance(
Object as)
{
if (as instanceof NoticeReference)
{
return (NoticeReference)as;
}
else if (as != null)
{
return new NoticeReference(ASN1Sequence.getInstance(as));
}
return null;
}
示例15: getContentInfos
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
* Return the content infos in the AuthenticatedSafe contained in this Pfx.
*
* @return an array of ContentInfo.
*/
public ContentInfo[] getContentInfos()
{
ASN1Sequence seq = ASN1Sequence.getInstance(ASN1OctetString.getInstance(this.pfx.getAuthSafe().getContent()).getOctets());
ContentInfo[] content = new ContentInfo[seq.size()];
for (int i = 0; i != seq.size(); i++)
{
content[i] = ContentInfo.getInstance(seq.getObjectAt(i));
}
return content;
}