Skip to main content

RsaOaepParams

Struct RsaOaepParams 

Source
pub struct RsaOaepParams<Params> {
    pub hash: AlgorithmIdentifier<Params>,
    pub mask_gen: AlgorithmIdentifier<AlgorithmIdentifier<Params>>,
    pub p_source: AlgorithmIdentifier<Params>,
}
Expand description

PKCS#1 RSAES-OAEP parameters as defined in RFC 8017 Appendix 2.1

ASN.1 structure containing a serialized RSAES-OAEP parameters:

RSAES-OAEP-params ::= SEQUENCE {
    hashAlgorithm      [0] HashAlgorithm     DEFAULT sha1,
    maskGenAlgorithm   [1] MaskGenAlgorithm  DEFAULT mgf1SHA1,
    pSourceAlgorithm   [2] PSourceAlgorithm  DEFAULT pSpecifiedEmpty
}
HashAlgorithm ::= AlgorithmIdentifier
MaskGenAlgorithm ::= AlgorithmIdentifier
PSourceAlgorithm ::= AlgorithmIdentifier

Fields§

§hash: AlgorithmIdentifier<Params>

Hash Algorithm

§mask_gen: AlgorithmIdentifier<AlgorithmIdentifier<Params>>

Mask Generation Function (MGF)

§p_source: AlgorithmIdentifier<Params>

The source (and possibly the value) of the label L

Implementations§

Source§

impl<Params> RsaOaepParams<Params>

Source§

impl<Params> RsaOaepParams<Params>

Source§

impl<'a> RsaOaepParams<AnyRef<'a>>

Source

pub fn new<D>() -> Self
where D: AssociatedOid,

Create new RsaOaepParams for the provided digest and default (empty) label

Source

pub fn new_with_label<D>(label: &'a impl AsRef<[u8]>) -> RsaOaepParamsRef<'a>
where D: AssociatedOid,

Create new RsaOaepParams for the provided digest and specified label

Trait Implementations§

Source§

impl<Params: Clone> Clone for RsaOaepParams<Params>

Source§

fn clone(&self) -> RsaOaepParams<Params>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Params: Debug> Debug for RsaOaepParams<Params>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, Params> DecodeValue<'a> for RsaOaepParams<Params>
where AlgorithmIdentifier<Params>: DecodeValue<'a, Error = Error> + FixedTag + From<AlgorithmIdentifierRef<'static>>, AlgorithmIdentifier<AlgorithmIdentifier<Params>>: DecodeValue<'a, Error = Error> + FixedTag, Params: 'a,

Source§

type Error = Error

Type returned in the event of a decoding error.
Source§

fn decode_value<R: Reader<'a>>(reader: &mut R, _header: Header) -> Result<Self>

Attempt to decode this value using the provided Reader. Read more
Source§

impl<Params> Default for RsaOaepParams<Params>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Params> EncodeValue for RsaOaepParams<Params>

Source§

fn value_len(&self) -> Result<Length>

Compute the length of this value (sans [Tag]+Length header) when encoded as ASN.1 DER. Read more
Source§

fn encode_value(&self, writer: &mut impl Writer) -> Result<()>

Encode value (sans [Tag]+Length header) as ASN.1 DER using the provided Writer. Read more
Source§

fn header(&self) -> Result<Header, Error>
where Self: Tagged,

Get the Header used to encode this value. Read more
Source§

impl<Params: PartialEq> PartialEq for RsaOaepParams<Params>

Source§

fn eq(&self, other: &RsaOaepParams<Params>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, Params> TryFrom<&'a [u8]> for RsaOaepParams<Params>
where AlgorithmIdentifier<Params>: DecodeValue<'a, Error = Error> + FixedTag + From<AlgorithmIdentifierRef<'static>>, AlgorithmIdentifier<AlgorithmIdentifier<Params>>: DecodeValue<'a, Error = Error> + FixedTag, Params: 'a,

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &'a [u8]) -> Result<Self>

Performs the conversion.
Source§

impl<Params: Eq> Eq for RsaOaepParams<Params>

Source§

impl<'a, Params> Sequence<'a> for RsaOaepParams<Params>

Source§

impl<Params> StructuralPartialEq for RsaOaepParams<Params>

Auto Trait Implementations§

§

impl<Params> Freeze for RsaOaepParams<Params>
where Params: Freeze,

§

impl<Params> RefUnwindSafe for RsaOaepParams<Params>
where Params: RefUnwindSafe,

§

impl<Params> Send for RsaOaepParams<Params>
where Params: Send,

§

impl<Params> Sync for RsaOaepParams<Params>
where Params: Sync,

§

impl<Params> Unpin for RsaOaepParams<Params>
where Params: Unpin,

§

impl<Params> UnsafeUnpin for RsaOaepParams<Params>
where Params: UnsafeUnpin,

§

impl<Params> UnwindSafe for RsaOaepParams<Params>
where Params: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<'a, T> Choice<'a> for T
where T: Decode<'a> + FixedTag,

Source§

fn can_decode(tag: Tag) -> bool

Is the provided Tag decodable as a variant of this CHOICE?
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<'a, T> Decode<'a> for T
where T: DecodeValue<'a> + FixedTag + 'a,

Source§

type Error = <T as DecodeValue<'a>>::Error

Type returned in the event of a decoding error.
Source§

fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>
where R: Reader<'a>,

Attempt to decode this TLV message using the provided decoder. Read more
Source§

fn from_der(bytes: &'a [u8]) -> Result<Self, Self::Error>

Parse Self from the provided DER-encoded byte slice. Read more
Source§

fn from_der_partial(bytes: &'a [u8]) -> Result<(Self, &'a [u8]), Self::Error>

Parse Self from the provided DER-encoded byte slice. Read more
Source§

impl<T> Encode for T
where T: EncodeValue + Tagged + ?Sized,

Source§

fn encoded_len(&self) -> Result<Length, Error>

Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§

fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode this TLV object as ASN.1 DER using the provided Writer. Read more
Source§

fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>

Encode this TLV object to the provided byte slice, returning a sub-slice containing the encoded message. Read more
Source§

fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>

Encode this TLV object as ASN.1 DER, appending it to the provided byte vector. Read more
Source§

fn to_der(&self) -> Result<Vec<u8>, Error>

Encode this TLV object as ASN.1 DER, returning a byte vector. Read more
Source§

impl<'a, S> FixedTag for S
where S: Sequence<'a>,

Source§

const TAG: Tag = Tag::Sequence

ASN.1 tag
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IsConstructed for T
where T: FixedTag + ?Sized,

Source§

const CONSTRUCTED: bool

ASN.1 constructed bit
Source§

impl<T> Tagged for T
where T: FixedTag + ?Sized,

Source§

fn tag(&self) -> Tag

Get the ASN.1 tag that this type is encoded with.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DecodeOwned for T
where T: for<'a> Decode<'a>,