org.spongycastle.asn1.isismtt.x509.AdditionalInformationSyntax Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scprov-jdk15 Show documentation
Show all versions of scprov-jdk15 Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for Android.
Android ships with a stripped-down version of Bouncy Castle - this causes classloader collisions if you try to add
an alternative (updated/complete) Bouncy Castle jar.
This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5.
package org.spongycastle.asn1.isismtt.x509;
import org.spongycastle.asn1.ASN1Encodable;
import org.spongycastle.asn1.ASN1String;
import org.spongycastle.asn1.DERObject;
import org.spongycastle.asn1.x500.DirectoryString;
/**
* Some other information of non-restrictive nature regarding the usage of this
* certificate.
*
*
* AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
*
*/
public class AdditionalInformationSyntax extends ASN1Encodable
{
private DirectoryString information;
public static AdditionalInformationSyntax getInstance(Object obj)
{
if (obj instanceof AdditionalInformationSyntax)
{
return (AdditionalInformationSyntax)obj;
}
if (obj instanceof ASN1String)
{
return new AdditionalInformationSyntax(DirectoryString.getInstance(obj));
}
throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
}
private AdditionalInformationSyntax(DirectoryString information)
{
this.information = information;
}
/**
* Constructor from a given details.
*
* @param information The describtion of the information.
*/
public AdditionalInformationSyntax(String information)
{
this(new DirectoryString(information));
}
public DirectoryString getInformation()
{
return information;
}
/**
* Produce an object suitable for an ASN1OutputStream.
*
* Returns:
*
*
* AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
*
*
* @return a DERObject
*/
public DERObject toASN1Object()
{
return information.toASN1Object();
}
}