File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -842,6 +842,27 @@ where
842842 }
843843 }
844844
845+ /// Create a new random RSASSA-PSS signing key which produces "blinded"
846+ /// signatures.
847+ /// Digest output size is used as a salt length.
848+ pub fn random < R : CryptoRngCore + ?Sized > ( rng : & mut R , bit_size : usize ) -> Result < Self > {
849+ Self :: random_with_salt_len ( rng, bit_size, <D as Digest >:: output_size ( ) )
850+ }
851+
852+ /// Create a new random RSASSA-PSS signing key which produces "blinded"
853+ /// signatures with a salt of the given length.
854+ pub fn random_with_salt_len < R : CryptoRngCore + ?Sized > (
855+ rng : & mut R ,
856+ bit_size : usize ,
857+ salt_len : usize ,
858+ ) -> Result < Self > {
859+ Ok ( Self {
860+ inner : RsaPrivateKey :: new ( rng, bit_size) ?,
861+ salt_len,
862+ phantom : Default :: default ( ) ,
863+ } )
864+ }
865+
845866 /// Return specified salt length for this key
846867 pub fn salt_len ( & self ) -> usize {
847868 self . salt_len
You can’t perform that action at this time.
0 commit comments