Package org.bouncycastle.asn1
Class ASN1Object
- java.lang.Object
-
- org.bouncycastle.asn1.ASN1Object
-
- All Implemented Interfaces:
ASN1Encodable,Encodable
- Direct Known Subclasses:
AccessDescription,AlgorithmIdentifier,AltSignatureAlgorithm,AltSignatureValue,ASN1Primitive,AttCertIssuer,AttCertValidityPeriod,Attribute,Attribute,AttributeCertificate,AttributeCertificateInfo,AttributeTypeAndValue,AuthenticatedSafe,AuthorityInformationAccess,AuthorityKeyIdentifier,BasicConstraints,BasicOCSPResponse,BiometricData,CAST5CBCParameters,CCMParameters,CertBag,CertID,Certificate,CertificateList,CertificatePair,CertificatePolicies,CertificationRequest,CertificationRequestInfo,CertPolicyId,CertStatus,CMCEPrivateKey,CMCEPublicKey,ContentInfo,CRLBag,CRLDistPoint,CrlID,CRLNumber,CRLReason,DHDomainParameters,DHParameter,DHPublicKey,DHValidationParms,DigestInfo,DirectoryString,DisplayText,DistributionPoint,DistributionPointName,DomainParameters,DSAParameter,DSTU4145BinaryField,DSTU4145ECBinary,DSTU4145Params,DSTU4145PublicKey,ECGOST3410ParamSetParameters,ECPrivateKey,ECPrivateKeyStructure,ElGamalParameter,EncryptedData,EncryptedObjectStoreData,EncryptedPrivateKeyData,EncryptedPrivateKeyInfo,EncryptedSecretKeyData,EncryptionScheme,ExtendedKeyUsage,Extension,Extensions,ExternalValue,FalconPrivateKey,FalconPublicKey,GCMParameters,GeneralName,GeneralNames,GeneralSubtree,GMSSPrivateKey,GMSSPublicKey,Gost2814789EncryptedKey,Gost2814789KeyWrapParameters,GOST28147Parameters,GOST3410ParamSetParameters,GOST3410PublicKeyAlgParameters,GostR3410KeyTransport,GostR3410TransportParameters,Holder,IDEACBCPar,IetfAttrSyntax,Iso4217CurrencyCode,IssuerAndSerialNumber,IssuerSerial,IssuingDistributionPoint,KeyDerivationFunc,KeyPurposeId,KeySpecificInfo,KeyUsage,KMACwithSHAKE128_params,KMACwithSHAKE256_params,KyberPrivateKey,KyberPublicKey,LinkedCertificate,MacData,McElieceCCA2PrivateKey,McElieceCCA2PublicKey,McEliecePrivateKey,McEliecePublicKey,MonetaryValue,NameConstraints,NameOrPseudonym,NetscapeCertRequest,NoticeReference,ObjectData,ObjectDataSequence,ObjectDigestInfo,ObjectStore,ObjectStoreData,ObjectStoreIntegrityCheck,OCSPRequest,OCSPResponse,OCSPResponseStatus,OtherInfo,OtherName,ParSet,PBEParameter,PBES2Parameters,PBKDF2Params,PbkdMacIntegrityCheck,PBMAC1Params,PersonalData,Pfx,PKCS12PBEParams,PolicyConstraints,PolicyInformation,PolicyMappings,PolicyQualifierInfo,PrivateKeyInfo,PrivateKeyUsagePeriod,PublicKeyAndChallenge,QCStatement,RC2CBCParameter,RDN,Request,ResponderID,ResponseBytes,ResponseData,RevokedInfo,RoleSyntax,RSAESOAEPparams,RSAPrivateKey,RSAPrivateKeyStructure,RSAPublicKey,RSAPublicKeyStructure,RSASSAPSSparams,SABERPrivateKey,SABERPublicKey,SafeBag,ScryptParams,SecretKeyData,SemanticsInformation,ServiceLocator,Signature,SignatureCheck,SignedData,SignedPublicKeyAndChallenge,SignerInfo,SingleResponse,SPHINCS256KeyParams,SPHINCSPLUSPrivateKey,SPHINCSPLUSPublicKey,SubjectAltPublicKeyInfo,SubjectDirectoryAttributes,SubjectKeyIdentifier,SubjectPublicKeyInfo,Target,TargetInformation,Targets,TBSCertificate,TBSCertificateStructure,TBSCertList,TBSCertList.CRLEntry,TBSRequest,Time,TypeOfBiometricData,UserNotice,V2Form,ValidationParams,X500Name,X509Attribute,X509CertificateStructure,X509Extensions,X509KeyUsage,X509Name,X962Parameters,X9Curve,X9ECParameters,X9ECPoint,X9FieldElement,X9FieldID,XMSSKeyParams,XMSSMTKeyParams,XMSSMTPrivateKey,XMSSMTPublicKey,XMSSPrivateKey,XMSSPublicKey
public abstract class ASN1Object extends java.lang.Object implements ASN1Encodable, Encodable
Base class for defining an ASN.1 object.
-
-
Constructor Summary
Constructors Constructor Description ASN1Object()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidencodeTo(java.io.OutputStream output)voidencodeTo(java.io.OutputStream output, java.lang.String encoding)booleanequals(java.lang.Object o)byte[]getEncoded()Return the default BER or DER encoding for this object.byte[]getEncoded(java.lang.String encoding)Return either the default for "BER" or a DER encoding if "DER" is specified.protected static booleanhasEncodedTagValue(java.lang.Object obj, int tagValue)Return true if obj is a byte array and represents an object with the given tag value.inthashCode()abstract ASN1PrimitivetoASN1Primitive()Method providing a primitive representation of this object suitable for encoding.
-
-
-
Method Detail
-
encodeTo
public void encodeTo(java.io.OutputStream output) throws java.io.IOException- Throws:
java.io.IOException
-
encodeTo
public void encodeTo(java.io.OutputStream output, java.lang.String encoding) throws java.io.IOException- Throws:
java.io.IOException
-
getEncoded
public byte[] getEncoded() throws java.io.IOExceptionReturn the default BER or DER encoding for this object.- Specified by:
getEncodedin interfaceEncodable- Returns:
- BER/DER byte encoded object.
- Throws:
java.io.IOException- on encoding error.
-
getEncoded
public byte[] getEncoded(java.lang.String encoding) throws java.io.IOExceptionReturn either the default for "BER" or a DER encoding if "DER" is specified.- Parameters:
encoding- name of encoding to use.- Returns:
- byte encoded object.
- Throws:
java.io.IOException- on encoding error.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hasEncodedTagValue
protected static boolean hasEncodedTagValue(java.lang.Object obj, int tagValue)Return true if obj is a byte array and represents an object with the given tag value.- Parameters:
obj- object of interest.tagValue- tag value to check for.- Returns:
- true if obj is a byte encoding starting with the given tag value, false otherwise.
-
toASN1Primitive
public abstract ASN1Primitive toASN1Primitive()
Method providing a primitive representation of this object suitable for encoding.- Specified by:
toASN1Primitivein interfaceASN1Encodable- Returns:
- a primitive representation of this object.
-
-