react-native-rsa-native
Advanced tools
Comparing version 1.1.4 to 2.0.0
@@ -6,32 +6,68 @@ declare module 'react-native-rsa-native' { | ||
interface CSRKey { | ||
csr: string; | ||
} | ||
interface KeyPair extends PublicKey { | ||
private: string; | ||
} | ||
type TypeCrypto = | ||
'SHA256withRSA'| | ||
'SHA512withRSA'| | ||
'SHA1withRSA'| | ||
'SHA256withECDSA'| | ||
'SHA512withECDSA'| | ||
'SHA1withECDSA' | ||
namespace RSA { | ||
export function generate(keySize: number): Promise<PublicKey>; | ||
export function generate(): Promise<PublicKey>; | ||
export function generateKeys(keySize: number): Promise<KeyPair>; | ||
export function encrypt(data: string, key: string): Promise<string>; | ||
export function decrypt(data: string, key: string): Promise<string>; | ||
export function encrypt64(data: string, key: string): Promise<string>; | ||
export function decrypt64(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 signWithAlgorithm(data: string, key: string, signature?: TypeCrypto): Promise<string>; | ||
export function sign64(data: string, key: string): Promise<string>; | ||
export function sign64WithAlgorithm(data: string, key: string, signature?: TypeCrypto): Promise<string>; | ||
export function verify(data: string, secretToVerify: string, key: string): Promise<boolean>; | ||
export function verifyWithAlgorithm(data: string, secretToVerify: string, key: string, signature?: 'SHA256withRSA' | 'SHA512withRSA'): Promise<boolean>; | ||
export function verifyWithAlgorithm(data: string, secretToVerify: string, key: string, signature?: TypeCrypto): Promise<boolean>; | ||
export function verify64(data: string, secretToVerify: string, key: string): Promise<boolean>; | ||
export function verify64WithAlgorithm(data: string, secretToVerify: string, key: string, signature?: TypeCrypto): Promise<boolean>; | ||
export const SHA256withRSA: string; | ||
export const SHA512withRSA: string; | ||
export const SHA1withRSA: string; | ||
export const SHA256withECDSA: string; | ||
export const SHA512withECDSA: string; | ||
export const SHA1withECDSA: string; | ||
} | ||
namespace RSAKeychain { | ||
export function generate(keyTag: string, keySize: number): Promise<PublicKey>; | ||
export function generate(keyTag: string): Promise<PublicKey>; | ||
export function generateEC(keyTag: string): Promise<PublicKey>; | ||
export function generateCSR(keyTag: string, CN: string, signature?: TypeCrypto): Promise<CSRKey>; | ||
export function generateKeys(keyTag: string, keySize: number): Promise<PublicKey>; | ||
export function generateCSRWithEC(cn: String,keyTag: string, keySize: number): Promise<PublicKey & CSRKey>; | ||
export function deletePrivateKey(keyTag: string): Promise<boolean>; | ||
export function encrypt(data: string, keyTag: string): Promise<string>; | ||
export function decrypt(data: string, keyTag: string): Promise<string>; | ||
export function encrypt64(data: string, keyTag: string): Promise<string>; | ||
export function decrypt64(data: string, keyTag: string): Promise<string>; | ||
export function sign(data: string, keyTag: string): Promise<string>; | ||
export function signWithAlgorithm(data: string, keyTag: string, signature?: 'SHA256withRSA' | 'SHA512withRSA'): Promise<string>; | ||
export function signWithAlgorithm(data: string, keyTag: string, signature?: TypeCrypto): Promise<string>; | ||
export function sign64WithAlgorithm(data: string, keyTag: string, signature?: TypeCrypto): Promise<string>; | ||
export function verify(data: string, secretToVerify: string, keyTag: string): Promise<boolean>; | ||
export function verifyWithAlgorithm(data: string, secretToVerify: string, keyTag: string, signature?: 'SHA256withRSA' | 'SHA512withRSA'): Promise<boolean>; | ||
export function verifyWithAlgorithm(data: string, secretToVerify: string, keyTag: string, signature?: TypeCrypto): Promise<boolean>; | ||
export function verify64WithAlgorithm(data: string, secretToVerify: string, keyTag: string, signature?: TypeCrypto): Promise<boolean>; | ||
export function getPublicKey(keyTag: string): Promise<string | undefined>; | ||
export function getPublicKeyDER(keyTag: string): Promise<string | undefined>; | ||
export function getPublicKeyRSA(keyTag: string): Promise<string | undefined>; | ||
export function deletePrivateKey(keyTag: string): Promise<boolean>; | ||
export const SHA256withRSA: string; | ||
export const SHA512withRSA: string; | ||
export const SHA1withRSA: string; | ||
export const SHA256withECDSA: string; | ||
export const SHA512withECDSA: string; | ||
export const SHA1withECDSA: string; | ||
} | ||
@@ -38,0 +74,0 @@ |
{ | ||
"name": "react-native-rsa-native", | ||
"version": "1.1.4", | ||
"version": "2.0.0", | ||
"description": "A native implementation of RSA key generation and encryption/decryption.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,10 +30,5 @@ # react-native-rsa-native | ||
### Mostly automatic installation: | ||
## Older React-Native versions | ||
If you are using an older version of React Native and are having issues try using v1.1.14 | ||
`$ react-native link react-native-rsa-native` | ||
## iOS | ||
In your React Native Xcode project, right click on your project and go 'Add Files to ...', then navigate to <your-project-root>/node_modules/react-native-rsa-native/ios and select the RNRSA.xcodeproj file. Then in the build settings for your target under 'Link Binary With Libraries', add libRNRSA.a. | ||
## Example Usage | ||
@@ -40,0 +35,0 @@ |
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
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
11021987
1092
7232
3
70
237