Top Description Constructors Methods
org.bouncycastle.asn1

public abstract Class ASN1Object

extends Object
implements ASN1Encodable, Encodable
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.Encodable, org.bouncycastle.asn1.ASN1Encodable
Known Direct Subclasses
org.bouncycastle.asn1.ASN1Primitive, org.bouncycastle.asn1.cryptopro.ECGOST3410ParamSetParameters, org.bouncycastle.asn1.cryptopro.Gost2814789EncryptedKey, org.bouncycastle.asn1.cryptopro.Gost2814789KeyWrapParameters, org.bouncycastle.asn1.cryptopro.GOST28147Parameters, org.bouncycastle.asn1.cryptopro.GOST3410ParamSetParameters, org.bouncycastle.asn1.cryptopro.GOST3410PublicKeyAlgParameters, org.bouncycastle.asn1.cryptopro.GostR3410KeyTransport, org.bouncycastle.asn1.cryptopro.GostR3410TransportParameters, org.bouncycastle.asn1.bc.EncryptedObjectStoreData, org.bouncycastle.asn1.bc.EncryptedPrivateKeyData, org.bouncycastle.asn1.bc.EncryptedSecretKeyData, org.bouncycastle.asn1.bc.ExternalValue, org.bouncycastle.asn1.bc.LinkedCertificate, org.bouncycastle.asn1.bc.ObjectData, org.bouncycastle.asn1.bc.ObjectDataSequence, org.bouncycastle.asn1.bc.ObjectStore, org.bouncycastle.asn1.bc.ObjectStoreData, org.bouncycastle.asn1.bc.ObjectStoreIntegrityCheck, org.bouncycastle.asn1.bc.PbkdMacIntegrityCheck, org.bouncycastle.asn1.bc.SecretKeyData, org.bouncycastle.asn1.bc.SignatureCheck, org.bouncycastle.asn1.nist.KMACwithSHAKE128_params, org.bouncycastle.asn1.nist.KMACwithSHAKE256_params, org.bouncycastle.asn1.ocsp.BasicOCSPResponse, org.bouncycastle.asn1.ocsp.CertID, org.bouncycastle.asn1.ocsp.CertStatus, org.bouncycastle.asn1.ocsp.CrlID, org.bouncycastle.asn1.ocsp.OCSPRequest, org.bouncycastle.asn1.ocsp.OCSPResponse, org.bouncycastle.asn1.ocsp.OCSPResponseStatus, org.bouncycastle.asn1.ocsp.Request, org.bouncycastle.asn1.ocsp.ResponderID, org.bouncycastle.asn1.ocsp.ResponseBytes, org.bouncycastle.asn1.ocsp.ResponseData, org.bouncycastle.asn1.ocsp.RevokedInfo, org.bouncycastle.asn1.ocsp.ServiceLocator, org.bouncycastle.asn1.ocsp.Signature, org.bouncycastle.asn1.ocsp.SingleResponse, org.bouncycastle.asn1.ocsp.TBSRequest, org.bouncycastle.asn1.pkcs.Attribute, org.bouncycastle.asn1.pkcs.AuthenticatedSafe, org.bouncycastle.asn1.pkcs.CertBag, org.bouncycastle.asn1.pkcs.CertificationRequest, org.bouncycastle.asn1.pkcs.CertificationRequestInfo, org.bouncycastle.asn1.pkcs.ContentInfo, org.bouncycastle.asn1.pkcs.CRLBag, org.bouncycastle.asn1.pkcs.DHParameter, org.bouncycastle.asn1.pkcs.EncryptedData, org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo, org.bouncycastle.asn1.pkcs.EncryptionScheme, org.bouncycastle.asn1.pkcs.IssuerAndSerialNumber, org.bouncycastle.asn1.pkcs.KeyDerivationFunc, org.bouncycastle.asn1.pkcs.MacData, org.bouncycastle.asn1.pkcs.PBEParameter, org.bouncycastle.asn1.pkcs.PBES2Parameters, org.bouncycastle.asn1.pkcs.PBKDF2Params, org.bouncycastle.asn1.pkcs.PBMAC1Params, org.bouncycastle.asn1.pkcs.Pfx, org.bouncycastle.asn1.pkcs.PKCS12PBEParams, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.pkcs.RC2CBCParameter, org.bouncycastle.asn1.pkcs.RSAESOAEPparams, org.bouncycastle.asn1.pkcs.RSAPrivateKey, org.bouncycastle.asn1.pkcs.RSAPrivateKeyStructure, org.bouncycastle.asn1.pkcs.RSAPublicKey, org.bouncycastle.asn1.pkcs.RSASSAPSSparams, org.bouncycastle.asn1.pkcs.SafeBag, org.bouncycastle.asn1.pkcs.SignedData, org.bouncycastle.asn1.pkcs.SignerInfo, org.bouncycastle.asn1.sec.ECPrivateKey, org.bouncycastle.asn1.sec.ECPrivateKeyStructure, org.bouncycastle.asn1.ua.DSTU4145BinaryField, org.bouncycastle.asn1.ua.DSTU4145ECBinary, org.bouncycastle.asn1.ua.DSTU4145Params, org.bouncycastle.asn1.ua.DSTU4145PublicKey, org.bouncycastle.asn1.x500.AttributeTypeAndValue, org.bouncycastle.asn1.x500.DirectoryString, org.bouncycastle.asn1.x500.RDN, org.bouncycastle.asn1.x500.X500Name, org.bouncycastle.asn1.x509.AccessDescription, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.asn1.x509.AltSignatureAlgorithm, org.bouncycastle.asn1.x509.AltSignatureValue, org.bouncycastle.asn1.x509.AttCertIssuer, org.bouncycastle.asn1.x509.AttCertValidityPeriod, org.bouncycastle.asn1.x509.Attribute, org.bouncycastle.asn1.x509.AttributeCertificate, org.bouncycastle.asn1.x509.AttributeCertificateInfo, org.bouncycastle.asn1.x509.AuthorityInformationAccess, org.bouncycastle.asn1.x509.AuthorityKeyIdentifier, org.bouncycastle.asn1.x509.BasicConstraints, org.bouncycastle.asn1.x509.Certificate, org.bouncycastle.asn1.x509.CertificateList, org.bouncycastle.asn1.x509.CertificatePair, org.bouncycastle.asn1.x509.CertificatePolicies, org.bouncycastle.asn1.x509.CertPolicyId, org.bouncycastle.asn1.x509.CRLDistPoint, org.bouncycastle.asn1.x509.CRLNumber, org.bouncycastle.asn1.x509.CRLReason, org.bouncycastle.asn1.x509.DeltaCertificateDescriptor, org.bouncycastle.asn1.x509.DigestInfo, org.bouncycastle.asn1.x509.NoticeReference, org.bouncycastle.asn1.x509.ObjectDigestInfo, org.bouncycastle.asn1.x509.OtherName, org.bouncycastle.asn1.x509.PolicyConstraints, org.bouncycastle.asn1.x509.PolicyInformation, org.bouncycastle.asn1.x509.PolicyMappings, org.bouncycastle.asn1.x509.PolicyQualifierInfo, org.bouncycastle.asn1.x509.PrivateKeyUsagePeriod, org.bouncycastle.asn1.x509.RoleSyntax, org.bouncycastle.asn1.x509.RSAPublicKeyStructure, org.bouncycastle.asn1.x509.SubjectAltPublicKeyInfo, org.bouncycastle.asn1.x509.SubjectDirectoryAttributes, org.bouncycastle.asn1.x509.SubjectKeyIdentifier, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.asn1.x509.Target, org.bouncycastle.asn1.x509.TargetInformation, org.bouncycastle.asn1.x509.Targets, org.bouncycastle.asn1.x509.TBSCertificate, org.bouncycastle.asn1.x509.TBSCertList, org.bouncycastle.asn1.x509.TBSCertList.CRLEntry, org.bouncycastle.asn1.x509.Time, org.bouncycastle.asn1.x509.UserNotice, org.bouncycastle.asn1.x509.V2Form, org.bouncycastle.asn1.x509.Validity, org.bouncycastle.asn1.x509.X509CertificateStructure, org.bouncycastle.asn1.x509.X509Extensions, org.bouncycastle.asn1.x509.X509Name, org.bouncycastle.asn1.x509.DistributionPoint, org.bouncycastle.asn1.x509.DistributionPointName, org.bouncycastle.asn1.x509.DSAParameter, org.bouncycastle.asn1.x509.ExtendedKeyUsage, org.bouncycastle.asn1.x509.Extension, org.bouncycastle.asn1.x509.Extensions, org.bouncycastle.asn1.x509.GeneralName, org.bouncycastle.asn1.x509.GeneralNames, org.bouncycastle.asn1.x509.GeneralSubtree, org.bouncycastle.asn1.x509.Holder, org.bouncycastle.asn1.x509.IetfAttrSyntax, org.bouncycastle.asn1.x509.IssuerSerial, org.bouncycastle.asn1.x509.IssuingDistributionPoint, org.bouncycastle.asn1.x509.KeyPurposeId, org.bouncycastle.asn1.x509.KeyUsage, org.bouncycastle.asn1.x509.NameConstraints, org.bouncycastle.asn1.x509.DisplayText, org.bouncycastle.asn1.x509.TBSCertificateStructure, org.bouncycastle.asn1.x509.qualified.BiometricData, org.bouncycastle.asn1.x509.qualified.Iso4217CurrencyCode, org.bouncycastle.asn1.x509.qualified.MonetaryValue, org.bouncycastle.asn1.x509.qualified.QCStatement, org.bouncycastle.asn1.x509.qualified.SemanticsInformation, org.bouncycastle.asn1.x509.qualified.TypeOfBiometricData, org.bouncycastle.asn1.x509.sigi.NameOrPseudonym, org.bouncycastle.asn1.x509.sigi.PersonalData, org.bouncycastle.asn1.x9.DHDomainParameters, org.bouncycastle.asn1.x9.DHPublicKey, org.bouncycastle.asn1.x9.DHValidationParms, org.bouncycastle.asn1.x9.DomainParameters, org.bouncycastle.asn1.x9.KeySpecificInfo, org.bouncycastle.asn1.x9.OtherInfo, org.bouncycastle.asn1.x9.ValidationParams, org.bouncycastle.asn1.x9.X962Parameters, org.bouncycastle.asn1.x9.X9Curve, org.bouncycastle.asn1.x9.X9ECParameters, org.bouncycastle.asn1.x9.X9ECPoint, org.bouncycastle.asn1.x9.X9FieldElement, org.bouncycastle.asn1.x9.X9FieldID, org.bouncycastle.internal.asn1.cms.CCMParameters, org.bouncycastle.internal.asn1.cms.GCMParameters, org.bouncycastle.internal.asn1.misc.CAST5CBCParameters, org.bouncycastle.internal.asn1.misc.IDEACBCPar, org.bouncycastle.internal.asn1.misc.ScryptParams, org.bouncycastle.internal.asn1.oiw.ElGamalParameter, org.bouncycastle.jce.X509KeyUsage, org.bouncycastle.jce.netscape.NetscapeCertRequest, org.bouncycastle.pqc.asn1.CMCEPrivateKey, org.bouncycastle.pqc.asn1.CMCEPublicKey, org.bouncycastle.pqc.asn1.FalconPrivateKey, org.bouncycastle.pqc.asn1.FalconPublicKey, org.bouncycastle.pqc.asn1.GMSSPrivateKey, org.bouncycastle.pqc.asn1.GMSSPublicKey, org.bouncycastle.pqc.asn1.KyberPrivateKey, org.bouncycastle.pqc.asn1.KyberPublicKey, org.bouncycastle.pqc.asn1.McElieceCCA2PrivateKey, org.bouncycastle.pqc.asn1.McElieceCCA2PublicKey, org.bouncycastle.pqc.asn1.McEliecePrivateKey, org.bouncycastle.pqc.asn1.McEliecePublicKey, org.bouncycastle.pqc.asn1.ParSet, org.bouncycastle.pqc.asn1.RainbowPrivateKey, org.bouncycastle.pqc.asn1.RainbowPublicKey, org.bouncycastle.pqc.asn1.SABERPrivateKey, org.bouncycastle.pqc.asn1.SABERPublicKey, org.bouncycastle.pqc.asn1.SPHINCS256KeyParams, org.bouncycastle.pqc.asn1.SPHINCSPLUSPrivateKey, org.bouncycastle.pqc.asn1.SPHINCSPLUSPublicKey, org.bouncycastle.pqc.asn1.XMSSKeyParams, org.bouncycastle.pqc.asn1.XMSSMTKeyParams, org.bouncycastle.pqc.asn1.XMSSMTPrivateKey, org.bouncycastle.pqc.asn1.XMSSMTPublicKey, org.bouncycastle.pqc.asn1.XMSSPrivateKey, org.bouncycastle.pqc.asn1.XMSSPublicKey, org.bouncycastle.x509.X509Attribute
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, org.bouncycastle.util.Encodable

Base class for defining an ASN.1 object.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
encodeTo(OutputStream output, String encoding)

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public byte[]

Returns:

BER/DER byte encoded object.
getEncoded
()

Implements org.bouncycastle.util.Encodable.getEncoded.

Return the default BER or DER encoding for this object.

public byte[]

Returns:

byte encoded object.
getEncoded
(String
name of encoding to use.
encoding
)

Return either the default for "BER" or a DER encoding if "DER" is specified.

protected static boolean

Returns:

true if obj is a byte encoding starting with the given tag value, false otherwise.
hasEncodedTagValue
(Object
object of interest.
obj
,
int
tag value to check for.
tagValue
)

Return true if obj is a byte array and represents an object with the given tag value.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public abstract ASN1Primitive

Returns:

a primitive representation of this object.
toASN1Primitive
()

Redeclares org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Method providing a primitive representation of this object suitable for encoding.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ASN1Objectback to summary
public ASN1Object()

Method Detail

encodeToback to summary
public void encodeTo(OutputStream output) throws IOException
encodeToback to summary
public void encodeTo(OutputStream output, String encoding) throws IOException
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getEncodedback to summary
public byte[] getEncoded() throws IOException

Implements org.bouncycastle.util.Encodable.getEncoded.

Return the default BER or DER encoding for this object.

Returns:byte[]

BER/DER byte encoded object.

Exceptions
IOException:
on encoding error.
getEncodedback to summary
public byte[] getEncoded(String encoding) throws IOException

Return either the default for "BER" or a DER encoding if "DER" is specified.

Parameters
encoding:String

name of encoding to use.

Returns:byte[]

byte encoded object.

Exceptions
IOException:
on encoding error.
hasEncodedTagValueback to summary
protected static boolean hasEncodedTagValue(Object obj, int tagValue)

Return true if obj is a byte array and represents an object with the given tag value.

Parameters
obj:Object

object of interest.

tagValue:int

tag value to check for.

Returns:boolean

true if obj is a byte encoding starting with the given tag value, false otherwise.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

toASN1Primitiveback to summary
public abstract ASN1Primitive toASN1Primitive()

Redeclares org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Method providing a primitive representation of this object suitable for encoding.

Returns:ASN1Primitive

a primitive representation of this object.