Methods Summary |
---|
static org.bouncycastle.asn1.ASN1Set | createBerSetFromList(java.util.List derObjects)
ASN1EncodableVector v = new ASN1EncodableVector();
for (Iterator it = derObjects.iterator(); it.hasNext();)
{
v.add((DEREncodable)it.next());
}
return new BERSet(v);
|
static org.bouncycastle.asn1.ASN1Set | createDerSetFromList(java.util.List derObjects)
ASN1EncodableVector v = new ASN1EncodableVector();
for (Iterator it = derObjects.iterator(); it.hasNext();)
{
v.add((DEREncodable)it.next());
}
return new DERSet(v);
|
static java.util.List | getCRLsFromStore(java.security.cert.CertStore certStore)
List crls = new ArrayList();
try
{
for (Iterator it = certStore.getCRLs(null).iterator(); it.hasNext();)
{
X509CRL c = (X509CRL)it.next();
crls.add(CertificateList.getInstance(ASN1Object.fromByteArray(c.getEncoded())));
}
return crls;
}
catch (IllegalArgumentException e)
{
throw new CMSException("error processing crls", e);
}
catch (IOException e)
{
throw new CMSException("error processing crls", e);
}
catch (CRLException e)
{
throw new CMSException("error encoding crls", e);
}
|
static java.util.List | getCertificatesFromStore(java.security.cert.CertStore certStore)
List certs = new ArrayList();
try
{
for (Iterator it = certStore.getCertificates(null).iterator(); it.hasNext();)
{
X509Certificate c = (X509Certificate)it.next();
certs.add(X509CertificateStructure.getInstance(
ASN1Object.fromByteArray(c.getEncoded())));
}
return certs;
}
catch (IllegalArgumentException e)
{
throw new CMSException("error processing certs", e);
}
catch (IOException e)
{
throw new CMSException("error processing certs", e);
}
catch (CertificateEncodingException e)
{
throw new CMSException("error encoding certs", e);
}
|
static int | getMaximumMemory()
long maxMem = RUNTIME.maxMemory();
if (maxMem > Integer.MAX_VALUE)
{
return Integer.MAX_VALUE;
}
return (int)maxMem;
|
public static java.security.Provider | getProvider(java.lang.String providerName)
if (providerName != null)
{
Provider prov = Security.getProvider(providerName);
if (prov != null)
{
return prov;
}
throw new NoSuchProviderException("provider " + providerName + " not found.");
}
return null;
|
static org.bouncycastle.asn1.cms.ContentInfo | readContentInfo(byte[] input)
// enforce limit checking as from a byte array
return readContentInfo(new ASN1InputStream(input));
|
static org.bouncycastle.asn1.cms.ContentInfo | readContentInfo(java.io.InputStream input)
// enforce some limit checking
return readContentInfo(new ASN1InputStream(input, getMaximumMemory()));
|
private static org.bouncycastle.asn1.cms.ContentInfo | readContentInfo(org.bouncycastle.asn1.ASN1InputStream in)
try
{
return ContentInfo.getInstance(in.readObject());
}
catch (IOException e)
{
throw new CMSException("IOException reading content.", e);
}
catch (ClassCastException e)
{
throw new CMSException("Malformed content.", e);
}
catch (IllegalArgumentException e)
{
throw new CMSException("Malformed content.", e);
}
|
public static byte[] | streamToByteArray(java.io.InputStream in)
return Streams.readAll(in);
|