pub struct PublicKey { /* private fields */ }Expand description
A raw public key for use with the certificate builder
Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn from_composite(
composite_pk: &CompositePublicKey,
) -> Result<Self, QuantCryptError>
pub fn from_composite( composite_pk: &CompositePublicKey, ) -> Result<Self, QuantCryptError>
sourcepub fn get_oid(&self) -> &str
pub fn get_oid(&self) -> &str
Get the OID for the DSA / KEM public key algorithm
§Returns
The OID for the DSA / KEM public key algorithm
sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
sourcepub fn to_pem(&self) -> Result<String, QuantCryptError>
pub fn to_pem(&self) -> Result<String, QuantCryptError>
sourcepub fn from_pem(pem: &str) -> Result<Self, QuantCryptError>
pub fn from_pem(pem: &str) -> Result<Self, QuantCryptError>
sourcepub fn from_der(der: &[u8]) -> Result<Self, QuantCryptError>
pub fn from_der(der: &[u8]) -> Result<Self, QuantCryptError>
Trait Implementations§
source§impl EncodePublicKey for PublicKey
impl EncodePublicKey for PublicKey
source§fn to_public_key_der(&self) -> Result<Document, Error>
fn to_public_key_der(&self) -> Result<Document, Error>
Serialize a
Document containing a SPKI-encoded public key.source§fn to_public_key_pem(&self, line_ending: LineEnding) -> Result<String, Error>
fn to_public_key_pem(&self, line_ending: LineEnding) -> Result<String, Error>
Serialize this public key as PEM-encoded SPKI with the given
LineEnding.source§fn write_public_key_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn write_public_key_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
Write ASN.1 DER-encoded public key to the given path
source§fn write_public_key_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding,
) -> Result<(), Error>
fn write_public_key_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>
Write ASN.1 DER-encoded public key to the given path
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> EncodeRsaPublicKey for Twhere
T: EncodePublicKey,
impl<T> EncodeRsaPublicKey for Twhere
T: EncodePublicKey,
source§fn to_pkcs1_der(&self) -> Result<Document, Error>
fn to_pkcs1_der(&self) -> Result<Document, Error>
Serialize a
Document containing a PKCS#1-encoded public key.source§fn to_pkcs1_pem(&self, line_ending: LineEnding) -> Result<String, Error>
fn to_pkcs1_pem(&self, line_ending: LineEnding) -> Result<String, Error>
Serialize this public key as PEM-encoded PKCS#1 with the given line ending.
source§fn write_pkcs1_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn write_pkcs1_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
Write ASN.1 DER-encoded public key to the given path.
source§fn write_pkcs1_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding,
) -> Result<(), Error>
fn write_pkcs1_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>
Write ASN.1 DER-encoded public key to the given path.