Struct ipfs_embed::identity::rsa::PublicKey
pub struct PublicKey(_);
Expand description
An RSA public key.
Implementations§
§impl PublicKey
impl PublicKey
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
Verify an RSA signature on a message using the public key.
pub fn encode_pkcs1(&self) -> Vec<u8, Global> ⓘ
pub fn encode_pkcs1(&self) -> Vec<u8, Global> ⓘ
Encode the RSA public key in DER as a PKCS#1 RSAPublicKey structure, as defined in RFC3447.
pub fn encode_x509(&self) -> Vec<u8, Global> ⓘ
pub fn encode_x509(&self) -> Vec<u8, Global> ⓘ
Encode the RSA public key in DER as a X.509 SubjectPublicKeyInfo structure, as defined in RFC5280.
pub fn decode_x509(pk: &[u8]) -> Result<PublicKey, DecodingError>
pub fn decode_x509(pk: &[u8]) -> Result<PublicKey, DecodingError>
Decode an RSA public key from a DER-encoded X.509 SubjectPublicKeyInfo
structure. See also encode_x509
.
Trait Implementations§
§impl Ord for PublicKey
impl Ord for PublicKey
§impl PartialOrd<PublicKey> for PublicKey
impl PartialOrd<PublicKey> for PublicKey
§fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more