本文整理汇总了Java中org.bouncycastle.asn1.ASN1Set.size方法的典型用法代码示例。如果您正苦于以下问题:Java ASN1Set.size方法的具体用法?Java ASN1Set.size怎么用?Java ASN1Set.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.ASN1Set
的用法示例。
在下文中一共展示了ASN1Set.size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributes
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
public Attribute[] getAttributes()
{
ASN1Set attrs = safeBag.getBagAttributes();
if (attrs == null)
{
return null;
}
Attribute[] attributes = new Attribute[attrs.size()];
for (int i = 0; i != attrs.size(); i++)
{
attributes[i] = Attribute.getInstance(attrs.getObjectAt(i));
}
return attributes;
}
示例2: getAttributes
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
* Return the attributes, if any associated with this request.
*
* @return an array of Attribute, zero length if none present.
*/
public Attribute[] getAttributes()
{
ASN1Set attrSet = certificationRequest.getCertificationRequestInfo().getAttributes();
if (attrSet == null)
{
return EMPTY_ARRAY;
}
Attribute[] attrs = new Attribute[attrSet.size()];
for (int i = 0; i != attrSet.size(); i++)
{
attrs[i] = Attribute.getInstance(attrSet.getObjectAt(i));
}
return attrs;
}
示例3: CscaMasterList
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
private CscaMasterList(
ASN1Sequence seq)
{
if (seq == null || seq.size() == 0)
{
throw new IllegalArgumentException(
"null or empty sequence passed.");
}
if (seq.size() != 2)
{
throw new IllegalArgumentException(
"Incorrect sequence size: " + seq.size());
}
version = ASN1Integer.getInstance(seq.getObjectAt(0));
ASN1Set certSet = ASN1Set.getInstance(seq.getObjectAt(1));
certList = new Certificate[certSet.size()];
for (int i = 0; i < certList.length; i++)
{
certList[i]
= Certificate.getInstance(certSet.getObjectAt(i));
}
}
示例4: getCertificates
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getCertificates(ASN1Set certSet)
{
if (certSet != null)
{
List certList = new ArrayList(certSet.size());
for (Enumeration en = certSet.getObjects(); en.hasMoreElements();)
{
ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();
if (obj instanceof ASN1Sequence)
{
certList.add(new X509CertificateHolder(Certificate.getInstance(obj)));
}
}
return new CollectionStore(certList);
}
return new CollectionStore(new ArrayList());
}
示例5: getAttributeCertificates
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getAttributeCertificates(ASN1Set certSet)
{
if (certSet != null)
{
List certList = new ArrayList(certSet.size());
for (Enumeration en = certSet.getObjects(); en.hasMoreElements();)
{
ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();
if (obj instanceof ASN1TaggedObject)
{
certList.add(new X509AttributeCertificateHolder(AttributeCertificate.getInstance(((ASN1TaggedObject)obj).getObject())));
}
}
return new CollectionStore(certList);
}
return new CollectionStore(new ArrayList());
}
示例6: getCRLs
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getCRLs(ASN1Set crlSet)
{
if (crlSet != null)
{
List crlList = new ArrayList(crlSet.size());
for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
{
ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();
if (obj instanceof ASN1Sequence)
{
crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
}
}
return new CollectionStore(crlList);
}
return new CollectionStore(new ArrayList());
}
示例7: getCertificates
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
* Return the certificates stored in the underlying OriginatorInfo object.
*
* @return a Store of X509CertificateHolder objects.
*/
public Store getCertificates()
{
ASN1Set certSet = originatorInfo.getCertificates();
if (certSet != null)
{
List certList = new ArrayList(certSet.size());
for (Enumeration en = certSet.getObjects(); en.hasMoreElements();)
{
ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();
if (obj instanceof ASN1Sequence)
{
certList.add(new X509CertificateHolder(Certificate.getInstance(obj)));
}
}
return new CollectionStore(certList);
}
return new CollectionStore(new ArrayList());
}
示例8: getCRLs
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
* Return the CRLs stored in the underlying OriginatorInfo object.
*
* @return a Store of X509CRLHolder objects.
*/
public Store getCRLs()
{
ASN1Set crlSet = originatorInfo.getCRLs();
if (crlSet != null)
{
List crlList = new ArrayList(crlSet.size());
for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
{
ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();
if (obj instanceof ASN1Sequence)
{
crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
}
}
return new CollectionStore(crlList);
}
return new CollectionStore(new ArrayList());
}
示例9: getValues
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
public ASN1Encodable[] getValues()
{
ASN1Set s = attr.getAttrValues();
ASN1Encodable[] values = new ASN1Encodable[s.size()];
for (int i = 0; i != s.size(); i++)
{
values[i] = (ASN1Encodable)s.getObjectAt(i);
}
return values;
}
示例10: AttributeTable
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
public AttributeTable(
ASN1Set s)
{
for (int i = 0; i != s.size(); i++)
{
Attribute a = Attribute.getInstance(s.getObjectAt(i));
addAttribute(a.getAttrType(), a);
}
}
示例11: getOtherRevocationInfo
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat, ASN1Set crlSet)
{
if (crlSet != null)
{
List crlList = new ArrayList(crlSet.size());
for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
{
ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();
if (obj instanceof ASN1TaggedObject)
{
ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(obj);
if (tObj.getTagNo() == 1)
{
OtherRevocationInfoFormat other = OtherRevocationInfoFormat.getInstance(tObj, false);
if (otherRevocationInfoFormat.equals(other.getInfoFormat()))
{
crlList.add(other.getInfo());
}
}
}
}
return new CollectionStore(crlList);
}
return new CollectionStore(new ArrayList());
}
示例12: buildRecipientInformationStore
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
static RecipientInformationStore buildRecipientInformationStore(
ASN1Set recipientInfos, AlgorithmIdentifier messageAlgorithm, CMSSecureReadable secureReadable, AuthAttributesProvider additionalData)
{
List infos = new ArrayList();
for (int i = 0; i != recipientInfos.size(); i++)
{
RecipientInfo info = RecipientInfo.getInstance(recipientInfos.getObjectAt(i));
readRecipientInfo(infos, info, messageAlgorithm, secureReadable, additionalData);
}
return new RecipientInformationStore(infos);
}
示例13: getSingleValuedSignedAttribute
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
private ASN1Primitive getSingleValuedSignedAttribute(
ASN1ObjectIdentifier attrOID, String printableName)
throws CMSException
{
AttributeTable unsignedAttrTable = this.getUnsignedAttributes();
if (unsignedAttrTable != null
&& unsignedAttrTable.getAll(attrOID).size() > 0)
{
throw new CMSException("The " + printableName
+ " attribute MUST NOT be an unsigned attribute");
}
AttributeTable signedAttrTable = this.getSignedAttributes();
if (signedAttrTable == null)
{
return null;
}
ASN1EncodableVector v = signedAttrTable.getAll(attrOID);
switch (v.size())
{
case 0:
return null;
case 1:
{
Attribute t = (Attribute)v.get(0);
ASN1Set attrValues = t.getAttrValues();
if (attrValues.size() != 1)
{
throw new CMSException("A " + printableName
+ " attribute MUST have a single attribute value");
}
return attrValues.getObjectAt(0).toASN1Primitive();
}
default:
throw new CMSException("The SignedAttributes in a signerInfo MUST NOT include multiple instances of the "
+ printableName + " attribute");
}
}
示例14: getSignerInfos
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
* return the collection of signers that are associated with the
* signatures for the message.
*/
public SignerInformationStore getSignerInfos()
{
if (signerInfoStore == null)
{
ASN1Set s = signedData.getSignerInfos();
List signerInfos = new ArrayList();
SignatureAlgorithmIdentifierFinder sigAlgFinder = new DefaultSignatureAlgorithmIdentifierFinder();
for (int i = 0; i != s.size(); i++)
{
SignerInfo info = SignerInfo.getInstance(s.getObjectAt(i));
ASN1ObjectIdentifier contentType = signedData.getEncapContentInfo().getContentType();
if (hashes == null)
{
signerInfos.add(new SignerInformation(info, contentType, signedContent, null));
}
else
{
Object obj = hashes.keySet().iterator().next();
byte[] hash = (obj instanceof String) ? (byte[])hashes.get(info.getDigestAlgorithm().getAlgorithm().getId()) : (byte[])hashes.get(info.getDigestAlgorithm().getAlgorithm());
signerInfos.add(new SignerInformation(info, contentType, null, hash));
}
}
signerInfoStore = new SignerInformationStore(signerInfos);
}
return signerInfoStore;
}
示例15: X509Name
import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
* Constructor from ASN1Sequence
*
* the principal will be a list of constructed sets, each containing an (OID, String) pair.
* @deprecated use X500Name.getInstance()
*/
public X509Name(
ASN1Sequence seq)
{
this.seq = seq;
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1Set set = ASN1Set.getInstance(((ASN1Encodable)e.nextElement()).toASN1Primitive());
for (int i = 0; i < set.size(); i++)
{
ASN1Sequence s = ASN1Sequence.getInstance(set.getObjectAt(i).toASN1Primitive());
if (s.size() != 2)
{
throw new IllegalArgumentException("badly sized pair");
}
ordering.addElement(ASN1ObjectIdentifier.getInstance(s.getObjectAt(0)));
ASN1Encodable value = s.getObjectAt(1);
if (value instanceof ASN1String && !(value instanceof DERUniversalString))
{
String v = ((ASN1String)value).getString();
if (v.length() > 0 && v.charAt(0) == '#')
{
values.addElement("\\" + v);
}
else
{
values.addElement(v);
}
}
else
{
try
{
values.addElement("#" + bytesToString(Hex.encode(value.toASN1Primitive().getEncoded(ASN1Encoding.DER))));
}
catch (IOException e1)
{
throw new IllegalArgumentException("cannot encode value");
}
}
added.addElement((i != 0) ? TRUE : FALSE); // to allow earlier JDK compatibility
}
}
}