pub struct AgreementMethod {
pub algorithm: KeyAgreementAlgorithm,
pub method: Option<KeyDerivationMethod>,
pub nonce: Vec<u8>,
pub legacy_digest: Option<String>,
pub originator: Option<KeyInfo>,
pub recipient: Option<KeyInfo>,
}Expand description
Public agreement descriptor. Key information is advisory; a document never supplies the application’s private handle or chooses its security profile.
Fields§
§algorithm: KeyAgreementAlgorithmExact agreement mechanism, independently permission checked at execution.
method: Option<KeyDerivationMethod>Explicit derivation; omission requires application knowledge except for the legacy DH algorithm, whose derivation is specified by its URI.
nonce: Vec<u8>Public agreement nonce, retained in the trusted descriptor comparison. Legacy DH incorporates it directly; explicit KDFs use their own context fields rather than an undocumented nonce concatenation.
legacy_digest: Option<String>Optional legacy DH digest. No default digest is guessed.
originator: Option<KeyInfo>Originator public key or application lookup hints in the original role.
recipient: Option<KeyInfo>Recipient lookup hints, never permission to substitute a private key.
Implementations§
Source§impl AgreementMethod
impl AgreementMethod
Sourcepub fn derive_key(
&self,
consuming_algorithm: &str,
output_len: usize,
key: &dyn KeyAgreementKey,
peer: &[u8],
provider: &dyn CryptoProvider,
budget: &mut KeyEstablishmentBudget<'_>,
) -> Result<Zeroizing<Vec<u8>>, XmlEncError>
pub fn derive_key( &self, consuming_algorithm: &str, output_len: usize, key: &dyn KeyAgreementKey, peer: &[u8], provider: &dyn CryptoProvider, budget: &mut KeyEstablishmentBudget<'_>, ) -> Result<Zeroizing<Vec<u8>>, XmlEncError>
Establish a consuming key with explicitly bound private and peer keys. The caller validates party identities before invoking this method.