Skip to content

Commit 67433ca

Browse files
committed
opt
1 parent dbe6b0a commit 67433ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rsa.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ func DecryptPKCS1v15(ciphertext []byte, privateKey []byte) ([]byte, error) {
4848

4949
// ----------------- common --------------------------------
5050

51+
const (
52+
RsaKeyBits1024 = 1024
53+
RsaKeyBits2048 = 2048
54+
RsaKeyBits4096 = 4096
55+
)
56+
5157
func GenRSAKey(bits int) (privateKey, publicKey []byte, err error) {
5258
priKey, err := rsa.GenerateKey(rand.Reader, bits)
5359
if err != nil {

0 commit comments

Comments
 (0)