pub struct SerialNumber<P: Profile = Rfc5280> { /* private fields */ }
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.
Implementations§
source§impl<P: Profile> SerialNumber<P>
impl<P: Profile> SerialNumber<P>
sourcepub const MAX_LEN: Length = _
pub const MAX_LEN: Length = _
Maximum length in bytes for a SerialNumber
sourcepub fn new(bytes: &[u8]) -> Result<Self>
pub fn new(bytes: &[u8]) -> Result<Self>
Create a new SerialNumber
from a byte slice.
The byte slice must represent a positive integer.
Trait Implementations§
source§impl<P: Clone + Profile> Clone for SerialNumber<P>
impl<P: Clone + Profile> Clone for SerialNumber<P>
source§fn clone(&self) -> SerialNumber<P>
fn clone(&self) -> SerialNumber<P>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a, P: Profile> DecodeValue<'a> for SerialNumber<P>
impl<'a, P: Profile> DecodeValue<'a> for SerialNumber<P>
source§impl Display for SerialNumber
impl Display for SerialNumber
source§impl<P: Profile> EncodeValue for SerialNumber<P>
impl<P: Profile> EncodeValue for SerialNumber<P>
source§impl<P: Profile> FixedTag for SerialNumber<P>
impl<P: Profile> FixedTag for SerialNumber<P>
source§impl From<u16> for SerialNumber
impl From<u16> for SerialNumber
source§fn from(inner: u16) -> SerialNumber
fn from(inner: u16) -> SerialNumber
source§impl From<u32> for SerialNumber
impl From<u32> for SerialNumber
source§fn from(inner: u32) -> SerialNumber
fn from(inner: u32) -> SerialNumber
source§impl From<u64> for SerialNumber
impl From<u64> for SerialNumber
source§fn from(inner: u64) -> SerialNumber
fn from(inner: u64) -> SerialNumber
source§impl From<u8> for SerialNumber
impl From<u8> for SerialNumber
source§fn from(inner: u8) -> SerialNumber
fn from(inner: u8) -> SerialNumber
source§impl From<usize> for SerialNumber
impl From<usize> for SerialNumber
source§fn from(inner: usize) -> SerialNumber
fn from(inner: usize) -> SerialNumber
source§impl<P: Ord + Profile> Ord for SerialNumber<P>
impl<P: Ord + Profile> Ord for SerialNumber<P>
source§fn cmp(&self, other: &SerialNumber<P>) -> Ordering
fn cmp(&self, other: &SerialNumber<P>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<P: PartialOrd + Profile> PartialOrd for SerialNumber<P>
impl<P: PartialOrd + Profile> PartialOrd for SerialNumber<P>
source§impl ValueOrd for SerialNumber
impl ValueOrd for SerialNumber
impl<P: Eq + Profile> Eq for SerialNumber<P>
impl<P: Profile> StructuralPartialEq for SerialNumber<P>
Auto Trait Implementations§
impl<P> Freeze for SerialNumber<P>
impl<P> RefUnwindSafe for SerialNumber<P>where
P: RefUnwindSafe,
impl<P> Send for SerialNumber<P>where
P: Send,
impl<P> Sync for SerialNumber<P>where
P: Sync,
impl<P> Unpin for SerialNumber<P>where
P: Unpin,
impl<P> UnwindSafe for SerialNumber<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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
.