Struct x509_cert::certificate::TbsCertificateInner
source · pub struct TbsCertificateInner<P: Profile = Rfc5280> {
pub version: Version,
pub serial_number: SerialNumber<P>,
pub signature: AlgorithmIdentifierOwned,
pub issuer: Name,
pub validity: Validity,
pub subject: Name,
pub subject_public_key_info: SubjectPublicKeyInfoOwned,
pub issuer_unique_id: Option<BitString>,
pub subject_unique_id: Option<BitString>,
pub extensions: Option<Extensions>,
}
Expand description
X.509 TbsCertificate
as defined in RFC 5280 Section 4.1
ASN.1 structure containing the names of the subject and issuer, a public key associated with the subject, a validity period, and other associated information.
TBSCertificate ::= SEQUENCE {
version [0] EXPLICIT Version DEFAULT v1,
serialNumber CertificateSerialNumber,
signature AlgorithmIdentifier,
issuer Name,
validity Validity,
subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo,
issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
-- If present, version MUST be v2 or v3
subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
-- If present, version MUST be v2 or v3
extensions [3] Extensions OPTIONAL
-- If present, version MUST be v3 --
}
Fields§
§version: Version
The certificate version
Note that this value defaults to Version 1 per the RFC. However,
fields such as issuer_unique_id
, subject_unique_id
and extensions
require later versions. Care should be taken in order to ensure
standards compliance.
serial_number: SerialNumber<P>
§signature: AlgorithmIdentifierOwned
§issuer: Name
§validity: Validity
§subject: Name
§subject_public_key_info: SubjectPublicKeyInfoOwned
§issuer_unique_id: Option<BitString>
§subject_unique_id: Option<BitString>
§extensions: Option<Extensions>
Implementations§
source§impl<P: Profile> TbsCertificateInner<P>
impl<P: Profile> TbsCertificateInner<P>
sourcepub fn get<'a, T: Decode<'a> + AssociatedOid>(
&'a self
) -> Result<Option<(bool, T)>, Error>
pub fn get<'a, T: Decode<'a> + AssociatedOid>( &'a self ) -> Result<Option<(bool, T)>, Error>
Decodes a single extension
Returns an error if multiple of these extensions is present. Returns
Ok(None)
if the extension is not present. Returns a decoding error
if decoding failed. Otherwise returns the extension.
Trait Implementations§
source§impl<'arbitrary, P: Profile + Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for TbsCertificateInner<P>
impl<'arbitrary, P: Profile + Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for TbsCertificateInner<P>
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moresource§impl<P: Clone + Profile> Clone for TbsCertificateInner<P>
impl<P: Clone + Profile> Clone for TbsCertificateInner<P>
source§fn clone(&self) -> TbsCertificateInner<P>
fn clone(&self) -> TbsCertificateInner<P>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'__der_lifetime, P: Profile> DecodeValue<'__der_lifetime> for TbsCertificateInner<P>
impl<'__der_lifetime, P: Profile> DecodeValue<'__der_lifetime> for TbsCertificateInner<P>
source§impl<'__der_lifetime, P: Profile> EncodeValue for TbsCertificateInner<P>
impl<'__der_lifetime, P: Profile> EncodeValue for TbsCertificateInner<P>
source§impl<P: PartialEq + Profile> PartialEq for TbsCertificateInner<P>
impl<P: PartialEq + Profile> PartialEq for TbsCertificateInner<P>
source§fn eq(&self, other: &TbsCertificateInner<P>) -> bool
fn eq(&self, other: &TbsCertificateInner<P>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl ValueOrd for TbsCertificateInner
impl ValueOrd for TbsCertificateInner
impl<P: Eq + Profile> Eq for TbsCertificateInner<P>
impl<'__der_lifetime, P: Profile> Sequence<'__der_lifetime> for TbsCertificateInner<P>
impl<P: Profile> StructuralEq for TbsCertificateInner<P>
impl<P: Profile> StructuralPartialEq for TbsCertificateInner<P>
Auto Trait Implementations§
impl<P> RefUnwindSafe for TbsCertificateInner<P>where
P: RefUnwindSafe,
impl<P> Send for TbsCertificateInner<P>where
P: Send,
impl<P> Sync for TbsCertificateInner<P>where
P: Sync,
impl<P> Unpin for TbsCertificateInner<P>where
P: Unpin,
impl<P> UnwindSafe for TbsCertificateInner<P>where
P: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.