pub struct DerCertificate(/* private fields */);Expand description
DER-encoded X.509 certificate bytes
This type represents a certificate in DER format (binary ASN.1). Serializes as base64 in JSON.
§Example
use sigstore_types::DerCertificate;
// Parse from PEM (validates CERTIFICATE header)
let pem = "-----BEGIN CERTIFICATE-----\nYWJjZA==\n-----END CERTIFICATE-----";
let cert = DerCertificate::from_pem(pem).unwrap();
// Convert back to PEM
let pem_out = cert.to_pem();Implementations§
Source§impl DerCertificate
impl DerCertificate
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Create from a byte slice
Sourcepub fn from_base64(s: &str) -> Result<Self>
pub fn from_base64(s: &str) -> Result<Self>
Create from base64-encoded string
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume and return the inner bytes
Trait Implementations§
Source§impl AsRef<[u8]> for DerCertificate
impl AsRef<[u8]> for DerCertificate
Source§impl Clone for DerCertificate
impl Clone for DerCertificate
Source§fn clone(&self) -> DerCertificate
fn clone(&self) -> DerCertificate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DerCertificate
impl Debug for DerCertificate
Source§impl<'de> Deserialize<'de> for DerCertificate
impl<'de> Deserialize<'de> for DerCertificate
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DerCertificate
impl Display for DerCertificate
Source§impl From<&[u8]> for DerCertificate
impl From<&[u8]> for DerCertificate
Source§impl Hash for DerCertificate
impl Hash for DerCertificate
Source§impl PartialEq for DerCertificate
impl PartialEq for DerCertificate
Source§impl Serialize for DerCertificate
impl Serialize for DerCertificate
impl Eq for DerCertificate
impl StructuralPartialEq for DerCertificate
Auto Trait Implementations§
impl Freeze for DerCertificate
impl RefUnwindSafe for DerCertificate
impl Send for DerCertificate
impl Sync for DerCertificate
impl Unpin for DerCertificate
impl UnsafeUnpin for DerCertificate
impl UnwindSafe for DerCertificate
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)