com.fitbur.bouncycastle.asn1.x509.AuthorityInformationAccess Maven / Gradle / Ivy
package com.fitbur.bouncycastle.asn1.x509;
import com.fitbur.bouncycastle.asn1.ASN1EncodableVector;
import com.fitbur.bouncycastle.asn1.ASN1Object;
import com.fitbur.bouncycastle.asn1.ASN1ObjectIdentifier;
import com.fitbur.bouncycastle.asn1.ASN1Primitive;
import com.fitbur.bouncycastle.asn1.ASN1Sequence;
import com.fitbur.bouncycastle.asn1.DERSequence;
/**
* The AuthorityInformationAccess object.
*
* id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
*
* AuthorityInfoAccessSyntax ::=
* SEQUENCE SIZE (1..MAX) OF AccessDescription
* AccessDescription ::= SEQUENCE {
* accessMethod OBJECT IDENTIFIER,
* accessLocation GeneralName }
*
* id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
* id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
* id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
*
*/
public class AuthorityInformationAccess
extends ASN1Object
{
private AccessDescription[] com.fitburscriptions;
public static AuthorityInformationAccess getInstance(
Object obj)
{
if (obj instanceof AuthorityInformationAccess)
{
return (AuthorityInformationAccess)obj;
}
if (obj != null)
{
return new AuthorityInformationAccess(ASN1Sequence.getInstance(obj));
}
return null;
}
private AuthorityInformationAccess(
ASN1Sequence seq)
{
if (seq.size() < 1)
{
throw new IllegalArgumentException("sequence may not be empty");
}
com.fitburscriptions = new AccessDescription[seq.size()];
for (int i = 0; i != seq.size(); i++)
{
com.fitburscriptions[i] = AccessDescription.getInstance(seq.getObjectAt(i));
}
}
public AuthorityInformationAccess(
AccessDescription com.fitburscription)
{
this.com.fitburscriptions = new AccessDescription[]{ com.fitburscription };
}
/**
* create an AuthorityInformationAccess with the oid and location provided.
*/
public AuthorityInformationAccess(
ASN1ObjectIdentifier oid,
GeneralName location)
{
this(new AccessDescription(oid, location));
}
/**
*
* @return the access com.fitburscriptions contained in this object.
*/
public AccessDescription[] getAccessDescriptions()
{
return com.fitburscriptions;
}
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector vec = new ASN1EncodableVector();
for (int i = 0; i != com.fitburscriptions.length; i++)
{
vec.add(com.fitburscriptions[i]);
}
return new DERSequence(vec);
}
public String toString()
{
return ("AuthorityInformationAccess: Oid(" + this.com.fitburscriptions[0].getAccessMethod().getId() + ")");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy