本文整理匯總了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;
}