aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-03-08 12:45:53 +0100
committerHans Nilsson <[email protected]>2017-03-09 15:42:30 +0100
commitbde627c1b34a19f36b7de777608119ff4a554cfa (patch)
tree164c0487b834b2973900cf0872b26d96f313af08
parent123a89c9d6bb1696ee0967c24422a5a8c0961907 (diff)
downloadotp-bde627c1b34a19f36b7de777608119ff4a554cfa.tar.gz
otp-bde627c1b34a19f36b7de777608119ff4a554cfa.tar.bz2
otp-bde627c1b34a19f36b7de777608119ff4a554cfa.zip
public_key: New -spec for public_key:generate_key/1
-rw-r--r--lib/public_key/src/public_key.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index 21d22d2c94..441a6e98d1 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -394,9 +394,15 @@ dh_gex_group(Min, N, Max, Groups) ->
pubkey_ssh:dh_gex_group(Min, N, Max, Groups).
%%--------------------------------------------------------------------
--spec generate_key(#'DHParameter'{} | {namedCurve, Name ::oid()} |
- #'ECParameters'{}) -> {Public::binary(), Private::binary()} |
- #'ECPrivateKey'{}.
+-spec generate_key(#'DHParameter'{}) ->
+ {Public::binary(), Private::binary()};
+ ({namedCurve, Name ::oid()}) ->
+ #'ECPrivateKey'{};
+ (#'ECParameters'{}) ->
+ #'ECPrivateKey'{};
+ ({rsa, Size::pos_integer(), PubExp::pos_integer()}) ->
+ {#'RSAPublicKey'{}, #'RSAPrivateKey'{}}.
+
%% Description: Generates a new keypair
%%--------------------------------------------------------------------
generate_key(#'DHParameter'{prime = P, base = G}) ->