Struct SerialNumber Copy item path Source pub struct SerialNumber<P: Profile = Rfc5280 > { }Expand description [RFC 5280 Section 4.1.2.2.] Serial Number
The serial number MUST be a positive integer assigned by the CA to
each certificate. It MUST be unique for each certificate issued by a
given CA (i.e., the issuer name and serial number identify a unique
certificate). CAs MUST force the serialNumber to be a non-negative
integer.
Given the uniqueness requirements above, serial numbers can be
expected to contain long integers. Certificate users MUST be able to
handle serialNumber values up to 20 octets. Conforming CAs MUST NOT
use serialNumber values longer than 20 octets.
Note: Non-conforming CAs may issue certificates with serial numbers
that are negative or zero. Certificate users SHOULD be prepared to
gracefully handle such certificates.
Create a new SerialNumber from a byte slice.
The byte slice must represent a positive integer.
Borrow the inner byte slice which contains the least significant bytes
of a big endian integer value with all leading zeros stripped.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Type returned in the event of a decoding error.
Formats the value using the given formatter.
Read more Compute the length of this value (sans [
Tag]+
Length header) when
encoded as ASN.1 DER.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more 🔬 This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range.
Read more This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more Return an
Ordering between value portion of TLV-encoded
self and
other when serialized as ASN.1 DER.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more Is the provided
Tag decodable as a variant of this
CHOICE?
🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Type returned in the event of a decoding error.
Attempt to decode this TLV message using the provided decoder.
Read more Parse
Self from the provided DER-encoded byte slice.
Read more Parse
Self from the provided DER-encoded byte slice.
Read more Compute the length of this TLV object in bytes when encoded as ASN.1 DER.
Read more Encode this TLV object to the provided byte slice, returning a sub-slice
containing the encoded message.
Read more Encode this TLV object as ASN.1 DER, appending it to the provided
byte vector.
Read more Encode this TLV object as ASN.1 DER, returning a byte vector.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
Get the ASN.1 tag that this type is encoded with.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.