react-native-rsa-native
Advanced tools
Comparing version 1.0.26 to 1.1.0
@@ -11,2 +11,3 @@ declare module 'react-native-rsa-native' { | ||
namespace RSA { | ||
export function generate(keySize: number): Promise<PublicKey>; | ||
export function generateKeys(keySize: number): Promise<KeyPair>; | ||
@@ -16,6 +17,10 @@ export function encrypt(data: string, key: string): Promise<string>; | ||
export function sign(data: string, key: string): Promise<string>; | ||
export function signWithAlgorithm(data: string, key: string, signature?: 'SHA256withRSA' | 'SHA512withRSA'): Promise<string>; | ||
export function verify(data: string, secretToVerify: string, key: string): Promise<boolean>; | ||
export const SHA256withRSA: string; | ||
export const SHA512withRSA: string; | ||
} | ||
namespace RSAKeychain { | ||
export function generate(keyTag: string, keySize: number): Promise<PublicKey>; | ||
export function generateKeys(keyTag: string, keySize: number): Promise<PublicKey>; | ||
@@ -26,4 +31,7 @@ export function deletePrivateKey(keyTag: string): Promise<boolean>; | ||
export function sign(data: string, keyTag: string): Promise<string>; | ||
export function signWithAlgorithm(data: string, keyTag: string, signature?: 'SHA256withRSA' | 'SHA512withRSA'): Promise<string>; | ||
export function verify(data: string, secretToVerify: string, keyTag: string): Promise<boolean>; | ||
export function getPublicKey(keyTag: string): Promise<string | undefined>; | ||
export const SHA256withRSA: string; | ||
export const SHA512withRSA: string; | ||
} | ||
@@ -30,0 +38,0 @@ |
import { NativeModules } from 'react-native'; | ||
const { RNRSAKeychain } = NativeModules; | ||
const { RNRSA } = NativeModules; | ||
const { RNRSAKeychain, RNRSA } = NativeModules; | ||
@@ -7,0 +6,0 @@ export { RNRSAKeychain, RNRSAKeychain as RSAKeychain, RNRSA, RNRSA as RSA }; |
{ | ||
"name": "react-native-rsa-native", | ||
"version": "1.0.26", | ||
"version": "1.1.0", | ||
"description": "A native implementation of RSA key generation and encryption/decryption.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,3 +10,3 @@ # react-native-rsa-native | ||
iOS 10+ | ||
android 4.1+ (API 16) | ||
android 4.3+ (API 18) | ||
@@ -186,2 +186,12 @@ ## Status | ||
#### signWithAlgorithm | ||
`static sign(message: string, keyTag : string, algorithm?: 'SHA256withRSA' | 'SHA512withRSA') : Promise<string>` | ||
Sign a given message with the private key associated with the given key tag, | ||
so that any user with | ||
the message, the returned signature, and the matching public key | ||
can verify it was signed under this key. The user can use __SHA256withRSA__ or __SHA512withRSA__ algorithm for signing. | ||
__SHA256withRSA__ algorithm is not backward compatible on android and the user needs to generate new keypair for this to work. (available from ^1.1.0). The default is __SHA512withRSA__ and if one wishes to use __SHA512withRSA__ for signing without new keypair, then use the above sign method. | ||
#### verify | ||
@@ -192,2 +202,7 @@ `static verify(signature : string, message : string, keyTag : string) : Promise<boolean>` | ||
#### verifyWithAlgorithm | ||
`static verify(signature : string, message : string, keyTag : string, algorithm?: 'SHA256withRSA' | 'SHA512withRSA') : Promise<boolean>` | ||
Verify whether or not a provided signature was produced by signing the given message with private key associated with the given key tag. | ||
#### deletePrivateKey | ||
@@ -194,0 +209,0 @@ `static deletePrivateKey(keyTag : string) : Promise<boolean>` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150688
25
37
241