Enum sequoia_ipc::sexp::Sexp
source · pub enum Sexp {
String(String_),
List(Vec<Sexp>),
}
Expand description
An S-Expression.
An S-Expression is either a string, or a list of S-Expressions.
Variants§
Implementations§
source§impl Sexp
impl Sexp
sourcepub fn finish_decryption<R>(
&self,
recipient: &Key<PublicParts, R>,
ciphertext: &Ciphertext,
plaintext_len: Option<usize>,
padding: bool
) -> Result<SessionKey>where
R: KeyRole,
pub fn finish_decryption<R>(
&self,
recipient: &Key<PublicParts, R>,
ciphertext: &Ciphertext,
plaintext_len: Option<usize>,
padding: bool
) -> Result<SessionKey>where
R: KeyRole,
Completes the decryption of this S-Expression representing a wrapped session key.
Such an expression is returned from gpg-agent’s PKDECRYPT
command. padding
must be set according to the status
messages sent.
sourcepub fn to_signature(&self) -> Result<Signature>
pub fn to_signature(&self) -> Result<Signature>
Parses this s-expression to a signature.
Such an expression is returned from gpg-agent’s PKSIGN
command.
sourcepub fn to_secret_key(&self, pk: Option<&PublicKey>) -> Result<SecretKeyMaterial>
pub fn to_secret_key(&self, pk: Option<&PublicKey>) -> Result<SecretKeyMaterial>
Parses this s-expression to a private key.
Such an expression is returned from gpg-agent’s EXPORT_KEY
command.
When exporting NIST and brainpool curves, gpg doesn’t indicate
whether the curve is an ECDSA curve (for signing) or an ECDH
curve (for encryption). As mpi::SecretKeyMaterial
needs
this information, it is necessary for the caller to provide
it. This information can be extract from the public key. If
None
is provided and the sexp
is unambiguous (e.g., it’s
an RSA key), then the secret key material is returned in the
expected form. If the sexp
is ambiguous and pk
is None
,
then mpi::SecretKeyMaterial::Unknown
is returned.