181 lines
27 KiB
HTML
181 lines
27 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Public key signatures: signing and verification."><title>ring::signature - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="ring" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module signature</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../ring/index.html">ring</a><span class="version">0.17.14</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module signature</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#algorithm-details" title="Algorithm Details">Algorithm Details</a><ul><li><a href="#ecdsa__asn1-details-asn1-encoded-ecdsa-signatures" title="`ECDSA_*_ASN1` Details: ASN.1-encoded ECDSA Signatures"><code>ECDSA_*_ASN1</code> Details: ASN.1-encoded ECDSA Signatures</a></li><li><a href="#ecdsa__fixed-details-fixed-length-pkcs11-style-ecdsa-signatures" title="`ECDSA_*_FIXED` Details: Fixed-length (PKCS#11-style) ECDSA Signatures"><code>ECDSA_*_FIXED</code> Details: Fixed-length (PKCS#11-style) ECDSA Signatures</a></li><li><a href="#rsa_pkcs1_-details-rsa-pkcs1-15-signatures" title="`RSA_PKCS1_*` Details: RSA PKCS#1 1.5 Signatures"><code>RSA_PKCS1_*</code> Details: RSA PKCS#1 1.5 Signatures</a></li><li><a href="#rsa_pss_-details-rsa-pss-signatures" title="`RSA_PSS_*` Details: RSA PSS Signatures"><code>RSA_PSS_*</code> Details: RSA PSS Signatures</a></li></ul></li><li><a href="#examples" title="Examples">Examples</a><ul><li><a href="#signing-and-verifying-with-ed25519" title="Signing and verifying with Ed25519">Signing and verifying with Ed25519</a></li><li><a href="#signing-and-verifying-with-rsa-pkcs1-15-padding" title="Signing and verifying with RSA (PKCS#1 1.5 padding)">Signing and verifying with RSA (PKCS#1 1.5 padding)</a></li></ul></li></ul><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#statics" title="Statics">Statics</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate ring</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">ring</a></div><h1>Module <span>signature</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/ring/signature.rs.html#15-409">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Public key signatures: signing and verification.</p>
|
||
<p>Use the <code>verify</code> function to verify signatures, passing a reference to the
|
||
algorithm that identifies the algorithm. See the documentation for <code>verify</code>
|
||
for examples.</p>
|
||
<p>For signature verification, this API treats each combination of parameters
|
||
as a separate algorithm. For example, instead of having a single “RSA”
|
||
algorithm with a verification function that takes a bunch of parameters,
|
||
there are <code>RSA_PKCS1_2048_8192_SHA256</code>, <code>RSA_PKCS1_2048_8192_SHA384</code>, etc.,
|
||
which encode sets of parameter choices into objects. This is designed to
|
||
reduce the risks of algorithm agility and to provide consistency with ECDSA
|
||
and EdDSA.</p>
|
||
<p>Currently this module does not support digesting the message to be signed
|
||
separately from the public key operation, as it is currently being
|
||
optimized for Ed25519 and for the implementation of protocols that do not
|
||
requiring signing large messages. An interface for efficiently supporting
|
||
larger messages may be added later.</p>
|
||
<h2 id="algorithm-details"><a class="doc-anchor" href="#algorithm-details">§</a>Algorithm Details</h2><h3 id="ecdsa__asn1-details-asn1-encoded-ecdsa-signatures"><a class="doc-anchor" href="#ecdsa__asn1-details-asn1-encoded-ecdsa-signatures">§</a><code>ECDSA_*_ASN1</code> Details: ASN.1-encoded ECDSA Signatures</h3>
|
||
<p>The signature is a ASN.1 DER-encoded <code>Ecdsa-Sig-Value</code> as described in
|
||
<a href="https://tools.ietf.org/html/rfc3279#section-2.2.3">RFC 3279 Section 2.2.3</a>. This is the form of ECDSA signature used in
|
||
X.509-related structures and in TLS’s <code>ServerKeyExchange</code> messages.</p>
|
||
<p>The public key is encoding in uncompressed form using the
|
||
Octet-String-to-Elliptic-Curve-Point algorithm in
|
||
<a href="http://www.secg.org/sec1-v2.pdf">SEC 1: Elliptic Curve Cryptography, Version 2.0</a>.</p>
|
||
<p>During verification, the public key is validated using the ECC Partial
|
||
Public-Key Validation Routine from Section 5.6.2.3.3 of
|
||
<a href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar2.pdf">NIST Special Publication 800-56A, revision 2</a> and Appendix A.3 of the
|
||
NSA’s <a href="https://github.com/briansmith/ring/blob/main/doc/ecdsa.pdf">Suite B implementer’s guide to FIPS 186-3</a>. Note that, as explained
|
||
in the NSA guide, ECC Partial Public-Key Validation is equivalent to ECC
|
||
Full Public-Key Validation for prime-order curves like this one.</p>
|
||
<h3 id="ecdsa__fixed-details-fixed-length-pkcs11-style-ecdsa-signatures"><a class="doc-anchor" href="#ecdsa__fixed-details-fixed-length-pkcs11-style-ecdsa-signatures">§</a><code>ECDSA_*_FIXED</code> Details: Fixed-length (PKCS#11-style) ECDSA Signatures</h3>
|
||
<p>The signature is <em>r</em>||<em>s</em>, where || denotes concatenation, and where both
|
||
<em>r</em> and <em>s</em> are both big-endian-encoded values that are left-padded to the
|
||
maximum length. A P-256 signature will be 64 bytes long (two 32-byte
|
||
components) and a P-384 signature will be 96 bytes long (two 48-byte
|
||
components). This is the form of ECDSA signature used PKCS#11 and DNSSEC.</p>
|
||
<p>The public key is encoding in uncompressed form using the
|
||
Octet-String-to-Elliptic-Curve-Point algorithm in
|
||
<a href="http://www.secg.org/sec1-v2.pdf">SEC 1: Elliptic Curve Cryptography, Version 2.0</a>.</p>
|
||
<p>During verification, the public key is validated using the ECC Partial
|
||
Public-Key Validation Routine from Section 5.6.2.3.3 of
|
||
<a href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar2.pdf">NIST Special Publication 800-56A, revision 2</a> and Appendix A.3 of the
|
||
NSA’s <a href="https://github.com/briansmith/ring/blob/main/doc/ecdsa.pdf">Suite B implementer’s guide to FIPS 186-3</a>. Note that, as explained
|
||
in the NSA guide, ECC Partial Public-Key Validation is equivalent to ECC
|
||
Full Public-Key Validation for prime-order curves like this one.</p>
|
||
<h3 id="rsa_pkcs1_-details-rsa-pkcs1-15-signatures"><a class="doc-anchor" href="#rsa_pkcs1_-details-rsa-pkcs1-15-signatures">§</a><code>RSA_PKCS1_*</code> Details: RSA PKCS#1 1.5 Signatures</h3>
|
||
<p>The signature is an RSASSA-PKCS1-v1_5 signature as described in
|
||
<a href="https://tools.ietf.org/html/rfc3447#section-7.2">RFC 3447 Section 8.2</a>.</p>
|
||
<p>The public key is encoded as an ASN.1 <code>RSAPublicKey</code> as described in
|
||
<a href="https://tools.ietf.org/html/rfc3447#appendix-A.1.1">RFC 3447 Appendix-A.1.1</a>. The public key modulus length, rounded <em>up</em> to
|
||
the nearest (larger) multiple of 8 bits, must be in the range given in the
|
||
name of the algorithm. The public exponent must be an odd integer of 2-33
|
||
bits, inclusive.</p>
|
||
<h3 id="rsa_pss_-details-rsa-pss-signatures"><a class="doc-anchor" href="#rsa_pss_-details-rsa-pss-signatures">§</a><code>RSA_PSS_*</code> Details: RSA PSS Signatures</h3>
|
||
<p>The signature is an RSASSA-PSS signature as described in
|
||
<a href="https://tools.ietf.org/html/rfc3447#section-8.1">RFC 3447 Section 8.1</a>.</p>
|
||
<p>The public key is encoded as an ASN.1 <code>RSAPublicKey</code> as described in
|
||
<a href="https://tools.ietf.org/html/rfc3447#appendix-A.1.1">RFC 3447 Appendix-A.1.1</a>. The public key modulus length, rounded <em>up</em> to
|
||
the nearest (larger) multiple of 8 bits, must be in the range given in the
|
||
name of the algorithm. The public exponent must be an odd integer of 2-33
|
||
bits, inclusive.</p>
|
||
<p>During verification, signatures will only be accepted if the MGF1 digest
|
||
algorithm is the same as the message digest algorithm and if the salt
|
||
length is the same length as the message digest. This matches the
|
||
requirements in TLS 1.3 and other recent specifications.</p>
|
||
<p>During signing, the message digest algorithm will be used as the MGF1
|
||
digest algorithm. The salt will be the same length as the message digest.
|
||
This matches the requirements in TLS 1.3 and other recent specifications.
|
||
Additionally, the entire salt is randomly generated separately for each
|
||
signature using the secure random number generator passed to <code>sign()</code>.</p>
|
||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2><h3 id="signing-and-verifying-with-ed25519"><a class="doc-anchor" href="#signing-and-verifying-with-ed25519">§</a>Signing and verifying with Ed25519</h3>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>ring::{
|
||
rand,
|
||
signature::{<span class="self">self</span>, KeyPair},
|
||
};
|
||
|
||
<span class="comment">// Generate a key pair in PKCS#8 (v2) format.
|
||
</span><span class="kw">let </span>rng = rand::SystemRandom::new();
|
||
<span class="kw">let </span>pkcs8_bytes = signature::Ed25519KeyPair::generate_pkcs8(<span class="kw-2">&</span>rng)<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// Normally the application would store the PKCS#8 file persistently. Later
|
||
// it would read the PKCS#8 file from persistent storage to use it.
|
||
|
||
</span><span class="kw">let </span>key_pair = signature::Ed25519KeyPair::from_pkcs8(pkcs8_bytes.as_ref())<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// Sign the message "hello, world".
|
||
</span><span class="kw">const </span>MESSAGE: <span class="kw-2">&</span>[u8] = <span class="string">b"hello, world"</span>;
|
||
<span class="kw">let </span>sig = key_pair.sign(MESSAGE);
|
||
|
||
<span class="comment">// Normally an application would extract the bytes of the signature and
|
||
// send them in a protocol message to the peer(s). Here we just get the
|
||
// public key key directly from the key pair.
|
||
</span><span class="kw">let </span>peer_public_key_bytes = key_pair.public_key().as_ref();
|
||
|
||
<span class="comment">// Verify the signature of the message using the public key. Normally the
|
||
// verifier of the message would parse the inputs to this code out of the
|
||
// protocol message(s) sent by the signer.
|
||
</span><span class="kw">let </span>peer_public_key =
|
||
signature::UnparsedPublicKey::new(<span class="kw-2">&</span>signature::ED25519, peer_public_key_bytes);
|
||
peer_public_key.verify(MESSAGE, sig.as_ref())<span class="question-mark">?</span>;
|
||
</code></pre></div><h3 id="signing-and-verifying-with-rsa-pkcs1-15-padding"><a class="doc-anchor" href="#signing-and-verifying-with-rsa-pkcs1-15-padding">§</a>Signing and verifying with RSA (PKCS#1 1.5 padding)</h3>
|
||
<p>By default OpenSSL writes RSA public keys in SubjectPublicKeyInfo format,
|
||
not RSAPublicKey format, and Base64-encodes them (“PEM” format).</p>
|
||
<p>To convert the PEM SubjectPublicKeyInfo format (“BEGIN PUBLIC KEY”) to the
|
||
binary RSAPublicKey format needed by <code>verify()</code>, use:</p>
|
||
<div class="example-wrap"><pre class="language-sh"><code>openssl rsa -pubin \
|
||
-in public_key.pem \
|
||
-inform PEM \
|
||
-RSAPublicKey_out \
|
||
-outform DER \
|
||
-out public_key.der</code></pre></div>
|
||
<p>To extract the RSAPublicKey-formatted public key from an ASN.1 (binary)
|
||
DER-encoded RSAPrivateKey format private key file, use:</p>
|
||
<div class="example-wrap"><pre class="language-sh"><code>openssl rsa -in private_key.der \
|
||
-inform DER \
|
||
-RSAPublicKey_out \
|
||
-outform DER \
|
||
-out public_key.der</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>ring::{rand, rsa, signature};
|
||
|
||
<span class="kw">fn </span>sign_and_verify_rsa(private_key_path: <span class="kw-2">&</span>std::path::Path,
|
||
public_key_path: <span class="kw-2">&</span>std::path::Path)
|
||
-> <span class="prelude-ty">Result</span><(), MyError> {
|
||
<span class="comment">// Create an RSA keypair from the DER-encoded bytes. This example uses
|
||
// a 2048-bit key, but larger keys are also supported.
|
||
</span><span class="kw">let </span>private_key_der = read_file(private_key_path)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>key_pair = rsa::KeyPair::from_der(<span class="kw-2">&</span>private_key_der)
|
||
.map_err(|<span class="kw">_</span>| MyError::BadPrivateKey)<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// Sign the message "hello, world", using PKCS#1 v1.5 padding and the
|
||
// SHA256 digest algorithm.
|
||
</span><span class="kw">const </span>MESSAGE: <span class="kw-2">&</span><span class="lifetime">'static </span>[u8] = <span class="string">b"hello, world"</span>;
|
||
<span class="kw">let </span>rng = rand::SystemRandom::new();
|
||
<span class="kw">let </span><span class="kw-2">mut </span>signature = <span class="macro">vec!</span>[<span class="number">0</span>; key_pair.public().modulus_len()];
|
||
key_pair.sign(<span class="kw-2">&</span>signature::RSA_PKCS1_SHA256, <span class="kw-2">&</span>rng, MESSAGE, <span class="kw-2">&mut </span>signature)
|
||
.map_err(|<span class="kw">_</span>| MyError::OOM)<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// Verify the signature.
|
||
</span><span class="kw">let </span>public_key =
|
||
signature::UnparsedPublicKey::new(<span class="kw-2">&</span>signature::RSA_PKCS1_2048_8192_SHA256,
|
||
read_file(public_key_path)<span class="question-mark">?</span>);
|
||
public_key.verify(MESSAGE, <span class="kw-2">&</span>signature)
|
||
.map_err(|<span class="kw">_</span>| MyError::BadSignature)
|
||
}
|
||
|
||
<span class="attr">#[derive(Debug)]
|
||
</span><span class="kw">enum </span>MyError {
|
||
IO(std::io::Error),
|
||
BadPrivateKey,
|
||
OOM,
|
||
BadSignature,
|
||
}
|
||
|
||
<span class="kw">fn </span>read_file(path: <span class="kw-2">&</span>std::path::Path) -> <span class="prelude-ty">Result</span><Vec<u8>, MyError> {
|
||
<span class="kw">use </span>std::io::Read;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>file = std::fs::File::open(path).map_err(|e| MyError::IO(e))<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>contents: Vec<u8> = Vec::new();
|
||
file.read_to_end(<span class="kw-2">&mut </span>contents).map_err(|e| MyError::IO(e))<span class="question-mark">?</span>;
|
||
<span class="prelude-val">Ok</span>(contents)
|
||
}</code></pre></div></div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.RsaParameters"><code>pub use crate::rsa::<a class="struct" href="../rsa/struct.RsaParameters.html" title="struct ring::rsa::RsaParameters">RsaParameters</a>;</code></dt></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.EcdsaKeyPair.html" title="struct ring::signature::EcdsaKeyPair">Ecdsa<wbr>KeyPair</a></dt><dd>An ECDSA key pair, used for signing.</dd><dt><a class="struct" href="struct.EcdsaSigningAlgorithm.html" title="struct ring::signature::EcdsaSigningAlgorithm">Ecdsa<wbr>Signing<wbr>Algorithm</a></dt><dd>An ECDSA signing algorithm.</dd><dt><a class="struct" href="struct.EcdsaVerificationAlgorithm.html" title="struct ring::signature::EcdsaVerificationAlgorithm">Ecdsa<wbr>Verification<wbr>Algorithm</a></dt><dd>An ECDSA verification algorithm.</dd><dt><a class="struct" href="struct.Ed25519KeyPair.html" title="struct ring::signature::Ed25519KeyPair">Ed25519<wbr>KeyPair</a></dt><dd>An Ed25519 key pair, for signing.</dd><dt><a class="struct" href="struct.EdDSAParameters.html" title="struct ring::signature::EdDSAParameters">EdDSA<wbr>Parameters</a></dt><dd>Parameters for EdDSA signing and verification.</dd><dt><a class="struct" href="struct.RsaPublicKeyComponents.html" title="struct ring::signature::RsaPublicKeyComponents">RsaPublic<wbr>KeyComponents</a></dt><dd>RSA public key components.</dd><dt><a class="struct" href="struct.Signature.html" title="struct ring::signature::Signature">Signature</a></dt><dd>A public key signature returned from a signing operation.</dd><dt><a class="struct" href="struct.UnparsedPublicKey.html" title="struct ring::signature::UnparsedPublicKey">Unparsed<wbr>Public<wbr>Key</a></dt><dd>An unparsed, possibly malformed, public key for signature verification.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.ED25519_PUBLIC_KEY_LEN.html" title="constant ring::signature::ED25519_PUBLIC_KEY_LEN">ED25519_<wbr>PUBLIC_<wbr>KEY_<wbr>LEN</a></dt><dd>The length of an Ed25519 public key.</dd></dl><h2 id="statics" class="section-header">Statics<a href="#statics" class="anchor">§</a></h2><dl class="item-table"><dt><a class="static" href="static.ECDSA_P256_SHA256_ASN1.html" title="static ring::signature::ECDSA_P256_SHA256_ASN1">ECDSA_<wbr>P256_<wbr>SHA256_<wbr>ASN1</a></dt><dd>Verification of ASN.1 DER-encoded ECDSA signatures using the P-256 curve
|
||
and SHA-256.</dd><dt><a class="static" href="static.ECDSA_P256_SHA256_ASN1_SIGNING.html" title="static ring::signature::ECDSA_P256_SHA256_ASN1_SIGNING">ECDSA_<wbr>P256_<wbr>SHA256_<wbr>ASN1_<wbr>SIGNING</a></dt><dd>Signing of ASN.1 DER-encoded ECDSA signatures using the P-256 curve and
|
||
SHA-256.</dd><dt><a class="static" href="static.ECDSA_P256_SHA256_FIXED.html" title="static ring::signature::ECDSA_P256_SHA256_FIXED">ECDSA_<wbr>P256_<wbr>SHA256_<wbr>FIXED</a></dt><dd>Verification of fixed-length (PKCS#11 style) ECDSA signatures using the
|
||
P-256 curve and SHA-256.</dd><dt><a class="static" href="static.ECDSA_P256_SHA256_FIXED_SIGNING.html" title="static ring::signature::ECDSA_P256_SHA256_FIXED_SIGNING">ECDSA_<wbr>P256_<wbr>SHA256_<wbr>FIXED_<wbr>SIGNING</a></dt><dd>Signing of fixed-length (PKCS#11 style) ECDSA signatures using the
|
||
P-256 curve and SHA-256.</dd><dt><a class="static" href="static.ECDSA_P256_SHA384_ASN1.html" title="static ring::signature::ECDSA_P256_SHA384_ASN1">ECDSA_<wbr>P256_<wbr>SHA384_<wbr>ASN1</a></dt><dd><em>Not recommended</em>. Verification of ASN.1 DER-encoded ECDSA signatures using
|
||
the P-256 curve and SHA-384.</dd><dt><a class="static" href="static.ECDSA_P384_SHA256_ASN1.html" title="static ring::signature::ECDSA_P384_SHA256_ASN1">ECDSA_<wbr>P384_<wbr>SHA256_<wbr>ASN1</a></dt><dd><em>Not recommended</em>. Verification of ASN.1 DER-encoded ECDSA signatures using
|
||
the P-384 curve and SHA-256.</dd><dt><a class="static" href="static.ECDSA_P384_SHA384_ASN1.html" title="static ring::signature::ECDSA_P384_SHA384_ASN1">ECDSA_<wbr>P384_<wbr>SHA384_<wbr>ASN1</a></dt><dd>Verification of ASN.1 DER-encoded ECDSA signatures using the P-384 curve
|
||
and SHA-384.</dd><dt><a class="static" href="static.ECDSA_P384_SHA384_ASN1_SIGNING.html" title="static ring::signature::ECDSA_P384_SHA384_ASN1_SIGNING">ECDSA_<wbr>P384_<wbr>SHA384_<wbr>ASN1_<wbr>SIGNING</a></dt><dd>Signing of ASN.1 DER-encoded ECDSA signatures using the P-384 curve and
|
||
SHA-384.</dd><dt><a class="static" href="static.ECDSA_P384_SHA384_FIXED.html" title="static ring::signature::ECDSA_P384_SHA384_FIXED">ECDSA_<wbr>P384_<wbr>SHA384_<wbr>FIXED</a></dt><dd>Verification of fixed-length (PKCS#11 style) ECDSA signatures using the
|
||
P-384 curve and SHA-384.</dd><dt><a class="static" href="static.ECDSA_P384_SHA384_FIXED_SIGNING.html" title="static ring::signature::ECDSA_P384_SHA384_FIXED_SIGNING">ECDSA_<wbr>P384_<wbr>SHA384_<wbr>FIXED_<wbr>SIGNING</a></dt><dd>Signing of fixed-length (PKCS#11 style) ECDSA signatures using the
|
||
P-384 curve and SHA-384.</dd><dt><a class="static" href="static.ED25519.html" title="static ring::signature::ED25519">ED25519</a></dt><dd>Verification of <a href="https://ed25519.cr.yp.to/">Ed25519</a> signatures.</dd><dt><a class="static" href="static.RSA_PKCS1_1024_8192_SHA1_FOR_LEGACY_USE_ONLY.html" title="static ring::signature::RSA_PKCS1_1024_8192_SHA1_FOR_LEGACY_USE_ONLY">RSA_<wbr>PKCS1_<wbr>1024_<wbr>8192_<wbr>SHA1_<wbr>FOR_<wbr>LEGACY_<wbr>USE_<wbr>ONLY</a></dt><dd>Verification of signatures using RSA keys of 1024-8192 bits,
|
||
PKCS#1.5 padding, and SHA-1.</dd><dt><a class="static" href="static.RSA_PKCS1_1024_8192_SHA256_FOR_LEGACY_USE_ONLY.html" title="static ring::signature::RSA_PKCS1_1024_8192_SHA256_FOR_LEGACY_USE_ONLY">RSA_<wbr>PKCS1_<wbr>1024_<wbr>8192_<wbr>SHA256_<wbr>FOR_<wbr>LEGACY_<wbr>USE_<wbr>ONLY</a></dt><dd>Verification of signatures using RSA keys of 1024-8192 bits,
|
||
PKCS#1.5 padding, and SHA-256.</dd><dt><a class="static" href="static.RSA_PKCS1_1024_8192_SHA512_FOR_LEGACY_USE_ONLY.html" title="static ring::signature::RSA_PKCS1_1024_8192_SHA512_FOR_LEGACY_USE_ONLY">RSA_<wbr>PKCS1_<wbr>1024_<wbr>8192_<wbr>SHA512_<wbr>FOR_<wbr>LEGACY_<wbr>USE_<wbr>ONLY</a></dt><dd>Verification of signatures using RSA keys of 1024-8192 bits,
|
||
PKCS#1.5 padding, and SHA-512.</dd><dt><a class="static" href="static.RSA_PKCS1_2048_8192_SHA1_FOR_LEGACY_USE_ONLY.html" title="static ring::signature::RSA_PKCS1_2048_8192_SHA1_FOR_LEGACY_USE_ONLY">RSA_<wbr>PKCS1_<wbr>2048_<wbr>8192_<wbr>SHA1_<wbr>FOR_<wbr>LEGACY_<wbr>USE_<wbr>ONLY</a></dt><dd>Verification of signatures using RSA keys of 2048-8192 bits,
|
||
PKCS#1.5 padding, and SHA-1.</dd><dt><a class="static" href="static.RSA_PKCS1_2048_8192_SHA256.html" title="static ring::signature::RSA_PKCS1_2048_8192_SHA256">RSA_<wbr>PKCS1_<wbr>2048_<wbr>8192_<wbr>SHA256</a></dt><dd>Verification of signatures using RSA keys of 2048-8192 bits,
|
||
PKCS#1.5 padding, and SHA-256.</dd><dt><a class="static" href="static.RSA_PKCS1_2048_8192_SHA384.html" title="static ring::signature::RSA_PKCS1_2048_8192_SHA384">RSA_<wbr>PKCS1_<wbr>2048_<wbr>8192_<wbr>SHA384</a></dt><dd>Verification of signatures using RSA keys of 2048-8192 bits,
|
||
PKCS#1.5 padding, and SHA-384.</dd><dt><a class="static" href="static.RSA_PKCS1_2048_8192_SHA512.html" title="static ring::signature::RSA_PKCS1_2048_8192_SHA512">RSA_<wbr>PKCS1_<wbr>2048_<wbr>8192_<wbr>SHA512</a></dt><dd>Verification of signatures using RSA keys of 2048-8192 bits,
|
||
PKCS#1.5 padding, and SHA-512.</dd><dt><a class="static" href="static.RSA_PKCS1_3072_8192_SHA384.html" title="static ring::signature::RSA_PKCS1_3072_8192_SHA384">RSA_<wbr>PKCS1_<wbr>3072_<wbr>8192_<wbr>SHA384</a></dt><dd>Verification of signatures using RSA keys of 3072-8192 bits,
|
||
PKCS#1.5 padding, and SHA-384.</dd><dt><a class="static" href="static.RSA_PKCS1_SHA256.html" title="static ring::signature::RSA_PKCS1_SHA256">RSA_<wbr>PKCS1_<wbr>SHA256</a></dt><dd>PKCS#1 1.5 padding using SHA-256 for RSA signatures.</dd><dt><a class="static" href="static.RSA_PKCS1_SHA384.html" title="static ring::signature::RSA_PKCS1_SHA384">RSA_<wbr>PKCS1_<wbr>SHA384</a></dt><dd>PKCS#1 1.5 padding using SHA-384 for RSA signatures.</dd><dt><a class="static" href="static.RSA_PKCS1_SHA512.html" title="static ring::signature::RSA_PKCS1_SHA512">RSA_<wbr>PKCS1_<wbr>SHA512</a></dt><dd>PKCS#1 1.5 padding using SHA-512 for RSA signatures.</dd><dt><a class="static" href="static.RSA_PSS_2048_8192_SHA256.html" title="static ring::signature::RSA_PSS_2048_8192_SHA256">RSA_<wbr>PSS_<wbr>2048_<wbr>8192_<wbr>SHA256</a></dt><dd>Verification of signatures using RSA keys of 2048-8192 bits,
|
||
PSS padding, and SHA-256.</dd><dt><a class="static" href="static.RSA_PSS_2048_8192_SHA384.html" title="static ring::signature::RSA_PSS_2048_8192_SHA384">RSA_<wbr>PSS_<wbr>2048_<wbr>8192_<wbr>SHA384</a></dt><dd>Verification of signatures using RSA keys of 2048-8192 bits,
|
||
PSS padding, and SHA-384.</dd><dt><a class="static" href="static.RSA_PSS_2048_8192_SHA512.html" title="static ring::signature::RSA_PSS_2048_8192_SHA512">RSA_<wbr>PSS_<wbr>2048_<wbr>8192_<wbr>SHA512</a></dt><dd>Verification of signatures using RSA keys of 2048-8192 bits,
|
||
PSS padding, and SHA-512.</dd><dt><a class="static" href="static.RSA_PSS_SHA256.html" title="static ring::signature::RSA_PSS_SHA256">RSA_<wbr>PSS_<wbr>SHA256</a></dt><dd>RSA PSS padding using SHA-256 for RSA signatures.</dd><dt><a class="static" href="static.RSA_PSS_SHA384.html" title="static ring::signature::RSA_PSS_SHA384">RSA_<wbr>PSS_<wbr>SHA384</a></dt><dd>RSA PSS padding using SHA-384 for RSA signatures.</dd><dt><a class="static" href="static.RSA_PSS_SHA512.html" title="static ring::signature::RSA_PSS_SHA512">RSA_<wbr>PSS_<wbr>SHA512</a></dt><dd>RSA PSS padding using SHA-512 for RSA signatures.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.KeyPair.html" title="trait ring::signature::KeyPair">KeyPair</a></dt><dd>Key pairs for signing messages (private key and public key).</dd><dt><a class="trait" href="trait.RsaEncoding.html" title="trait ring::signature::RsaEncoding">RsaEncoding</a></dt><dd>An RSA signature encoding as described in <a href="https://tools.ietf.org/html/rfc3447#section-8">RFC 3447 Section 8</a>.</dd><dt><a class="trait" href="trait.VerificationAlgorithm.html" title="trait ring::signature::VerificationAlgorithm">Verification<wbr>Algorithm</a></dt><dd>A signature verification algorithm.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.RsaKeyPair.html" title="type ring::signature::RsaKeyPair">RsaKey<wbr>Pair</a></dt><dd>An RSA key pair, used for signing.</dd></dl></section></div></main></body></html> |