@avieldr/react-native-rsa 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +453 -0
- package/Rsa.podspec +23 -0
- package/android/build.gradle +69 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/rsa/RsaModule.kt +129 -0
- package/android/src/main/java/com/rsa/RsaPackage.kt +33 -0
- package/android/src/main/java/com/rsa/core/ASN1Utils.kt +201 -0
- package/android/src/main/java/com/rsa/core/Algorithms.kt +126 -0
- package/android/src/main/java/com/rsa/core/KeyUtils.kt +83 -0
- package/android/src/main/java/com/rsa/core/RSACipher.kt +71 -0
- package/android/src/main/java/com/rsa/core/RSAKeyGenerator.kt +125 -0
- package/android/src/main/java/com/rsa/core/RSASigner.kt +70 -0
- package/ios/ASN1Utils.swift +225 -0
- package/ios/Algorithms.swift +89 -0
- package/ios/KeyUtils.swift +125 -0
- package/ios/RSACipher.swift +77 -0
- package/ios/RSAKeyGenerator.swift +164 -0
- package/ios/RSASigner.swift +101 -0
- package/ios/Rsa.h +61 -0
- package/ios/Rsa.mm +216 -0
- package/lib/module/NativeRsa.js +16 -0
- package/lib/module/NativeRsa.js.map +1 -0
- package/lib/module/constants.js +24 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/encoding.js +116 -0
- package/lib/module/encoding.js.map +1 -0
- package/lib/module/errors.js +135 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/index.js +232 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/keyInfo.js +286 -0
- package/lib/module/keyInfo.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeRsa.d.ts +32 -0
- package/lib/typescript/src/NativeRsa.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +21 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/encoding.d.ts +30 -0
- package/lib/typescript/src/encoding.d.ts.map +1 -0
- package/lib/typescript/src/errors.d.ts +47 -0
- package/lib/typescript/src/errors.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +122 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/keyInfo.d.ts +7 -0
- package/lib/typescript/src/keyInfo.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +63 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +133 -0
- package/src/NativeRsa.ts +59 -0
- package/src/constants.ts +25 -0
- package/src/encoding.ts +139 -0
- package/src/errors.ts +206 -0
- package/src/index.ts +305 -0
- package/src/keyInfo.ts +334 -0
- package/src/types.ts +85 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const PEM_HEADERS = {
|
|
4
|
+
pkcs1Private: '-----BEGIN RSA PRIVATE KEY-----',
|
|
5
|
+
pkcs1PrivateEnd: '-----END RSA PRIVATE KEY-----',
|
|
6
|
+
pkcs8Private: '-----BEGIN PRIVATE KEY-----',
|
|
7
|
+
pkcs8PrivateEnd: '-----END PRIVATE KEY-----',
|
|
8
|
+
public: '-----BEGIN PUBLIC KEY-----',
|
|
9
|
+
publicEnd: '-----END PUBLIC KEY-----'
|
|
10
|
+
};
|
|
11
|
+
function parseASN1Length(bytes, offset) {
|
|
12
|
+
if (offset >= bytes.length) {
|
|
13
|
+
return {
|
|
14
|
+
length: null,
|
|
15
|
+
bytesRead: 0
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const firstByte = bytes[offset];
|
|
19
|
+
if (firstByte < 128) {
|
|
20
|
+
return {
|
|
21
|
+
length: firstByte,
|
|
22
|
+
bytesRead: 1
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const numLengthBytes = firstByte & 0x7f;
|
|
26
|
+
if (numLengthBytes === 0 || offset + numLengthBytes >= bytes.length) {
|
|
27
|
+
return {
|
|
28
|
+
length: null,
|
|
29
|
+
bytesRead: 0
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
let length = 0;
|
|
33
|
+
for (let i = 0; i < numLengthBytes; i++) {
|
|
34
|
+
length = length << 8 | bytes[offset + 1 + i];
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
length,
|
|
38
|
+
bytesRead: 1 + numLengthBytes
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function validatePKCS1Structure(derBytes) {
|
|
42
|
+
const errors = [];
|
|
43
|
+
let offset = 0;
|
|
44
|
+
if (derBytes[offset] !== 0x30) {
|
|
45
|
+
errors.push(`Expected SEQUENCE tag (0x30), got 0x${derBytes[offset]?.toString(16)}`);
|
|
46
|
+
return errors;
|
|
47
|
+
}
|
|
48
|
+
offset++;
|
|
49
|
+
const {
|
|
50
|
+
length: seqLength,
|
|
51
|
+
bytesRead
|
|
52
|
+
} = parseASN1Length(derBytes, offset);
|
|
53
|
+
offset += bytesRead;
|
|
54
|
+
if (seqLength === null) {
|
|
55
|
+
errors.push('Invalid SEQUENCE length encoding');
|
|
56
|
+
return errors;
|
|
57
|
+
}
|
|
58
|
+
let integerCount = 0;
|
|
59
|
+
let tempOffset = offset;
|
|
60
|
+
const endOffset = offset + seqLength;
|
|
61
|
+
while (tempOffset < endOffset && tempOffset < derBytes.length) {
|
|
62
|
+
if (derBytes[tempOffset] !== 0x02) {
|
|
63
|
+
errors.push(`Expected INTEGER tag (0x02) at position ${tempOffset}, got 0x${derBytes[tempOffset]?.toString(16)}`);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
tempOffset++;
|
|
67
|
+
const {
|
|
68
|
+
length: intLength,
|
|
69
|
+
bytesRead: intBytesRead
|
|
70
|
+
} = parseASN1Length(derBytes, tempOffset);
|
|
71
|
+
if (intLength === null) {
|
|
72
|
+
errors.push('Invalid INTEGER length encoding');
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
tempOffset += intBytesRead + intLength;
|
|
76
|
+
integerCount++;
|
|
77
|
+
}
|
|
78
|
+
if (integerCount !== 9) {
|
|
79
|
+
errors.push(`Expected 9 INTEGER fields for PKCS#1, found ${integerCount}`);
|
|
80
|
+
}
|
|
81
|
+
return errors;
|
|
82
|
+
}
|
|
83
|
+
function validatePKCS8Structure(derBytes) {
|
|
84
|
+
const errors = [];
|
|
85
|
+
let offset = 0;
|
|
86
|
+
|
|
87
|
+
// Outer SEQUENCE
|
|
88
|
+
if (derBytes[offset] !== 0x30) {
|
|
89
|
+
errors.push(`Expected SEQUENCE tag (0x30), got 0x${derBytes[offset]?.toString(16)}`);
|
|
90
|
+
return errors;
|
|
91
|
+
}
|
|
92
|
+
offset++;
|
|
93
|
+
const {
|
|
94
|
+
length: seqLength,
|
|
95
|
+
bytesRead
|
|
96
|
+
} = parseASN1Length(derBytes, offset);
|
|
97
|
+
offset += bytesRead;
|
|
98
|
+
if (seqLength === null) {
|
|
99
|
+
errors.push('Invalid SEQUENCE length encoding');
|
|
100
|
+
return errors;
|
|
101
|
+
}
|
|
102
|
+
const endOffset = offset + seqLength;
|
|
103
|
+
|
|
104
|
+
// version INTEGER (should be 0)
|
|
105
|
+
if (offset >= endOffset || derBytes[offset] !== 0x02) {
|
|
106
|
+
errors.push(`Expected INTEGER tag (0x02) for version, got 0x${derBytes[offset]?.toString(16)}`);
|
|
107
|
+
return errors;
|
|
108
|
+
}
|
|
109
|
+
offset++;
|
|
110
|
+
const {
|
|
111
|
+
length: verLen,
|
|
112
|
+
bytesRead: verBytesRead
|
|
113
|
+
} = parseASN1Length(derBytes, offset);
|
|
114
|
+
if (verLen === null) {
|
|
115
|
+
errors.push('Invalid version INTEGER length');
|
|
116
|
+
return errors;
|
|
117
|
+
}
|
|
118
|
+
offset += verBytesRead + verLen;
|
|
119
|
+
|
|
120
|
+
// AlgorithmIdentifier SEQUENCE
|
|
121
|
+
if (offset >= endOffset || derBytes[offset] !== 0x30) {
|
|
122
|
+
errors.push(`Expected SEQUENCE tag (0x30) for AlgorithmIdentifier, got 0x${derBytes[offset]?.toString(16)}`);
|
|
123
|
+
return errors;
|
|
124
|
+
}
|
|
125
|
+
offset++;
|
|
126
|
+
const {
|
|
127
|
+
length: algLen,
|
|
128
|
+
bytesRead: algBytesRead
|
|
129
|
+
} = parseASN1Length(derBytes, offset);
|
|
130
|
+
if (algLen === null) {
|
|
131
|
+
errors.push('Invalid AlgorithmIdentifier length');
|
|
132
|
+
return errors;
|
|
133
|
+
}
|
|
134
|
+
offset += algBytesRead + algLen;
|
|
135
|
+
|
|
136
|
+
// privateKey OCTET STRING
|
|
137
|
+
if (offset >= endOffset || derBytes[offset] !== 0x04) {
|
|
138
|
+
errors.push(`Expected OCTET STRING tag (0x04) for privateKey, got 0x${derBytes[offset]?.toString(16)}`);
|
|
139
|
+
return errors;
|
|
140
|
+
}
|
|
141
|
+
return errors;
|
|
142
|
+
}
|
|
143
|
+
function validateSPKIStructure(derBytes) {
|
|
144
|
+
const errors = [];
|
|
145
|
+
let offset = 0;
|
|
146
|
+
|
|
147
|
+
// Outer SEQUENCE
|
|
148
|
+
if (derBytes[offset] !== 0x30) {
|
|
149
|
+
errors.push(`Expected SEQUENCE tag (0x30), got 0x${derBytes[offset]?.toString(16)}`);
|
|
150
|
+
return errors;
|
|
151
|
+
}
|
|
152
|
+
offset++;
|
|
153
|
+
const {
|
|
154
|
+
length: seqLength,
|
|
155
|
+
bytesRead
|
|
156
|
+
} = parseASN1Length(derBytes, offset);
|
|
157
|
+
offset += bytesRead;
|
|
158
|
+
if (seqLength === null) {
|
|
159
|
+
errors.push('Invalid SEQUENCE length encoding');
|
|
160
|
+
return errors;
|
|
161
|
+
}
|
|
162
|
+
const endOffset = offset + seqLength;
|
|
163
|
+
|
|
164
|
+
// AlgorithmIdentifier SEQUENCE
|
|
165
|
+
if (offset >= endOffset || derBytes[offset] !== 0x30) {
|
|
166
|
+
errors.push(`Expected SEQUENCE tag (0x30) for AlgorithmIdentifier, got 0x${derBytes[offset]?.toString(16)}`);
|
|
167
|
+
return errors;
|
|
168
|
+
}
|
|
169
|
+
offset++;
|
|
170
|
+
const {
|
|
171
|
+
length: algLen,
|
|
172
|
+
bytesRead: algBytesRead
|
|
173
|
+
} = parseASN1Length(derBytes, offset);
|
|
174
|
+
if (algLen === null) {
|
|
175
|
+
errors.push('Invalid AlgorithmIdentifier length');
|
|
176
|
+
return errors;
|
|
177
|
+
}
|
|
178
|
+
offset += algBytesRead + algLen;
|
|
179
|
+
|
|
180
|
+
// subjectPublicKey BIT STRING
|
|
181
|
+
if (offset >= endOffset || derBytes[offset] !== 0x03) {
|
|
182
|
+
errors.push(`Expected BIT STRING tag (0x03) for subjectPublicKey, got 0x${derBytes[offset]?.toString(16)}`);
|
|
183
|
+
return errors;
|
|
184
|
+
}
|
|
185
|
+
return errors;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Minimal base64 decoder (no external deps)
|
|
189
|
+
const BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
190
|
+
function base64Decode(input) {
|
|
191
|
+
const cleaned = input.replace(/[^A-Za-z0-9+/=]/g, '');
|
|
192
|
+
const len = cleaned.length;
|
|
193
|
+
const byteLen = len * 3 / 4 - (cleaned.endsWith('==') ? 2 : cleaned.endsWith('=') ? 1 : 0);
|
|
194
|
+
const bytes = new Uint8Array(byteLen);
|
|
195
|
+
let p = 0;
|
|
196
|
+
for (let i = 0; i < len; i += 4) {
|
|
197
|
+
const a = BASE64_CHARS.indexOf(cleaned[i]);
|
|
198
|
+
const b = BASE64_CHARS.indexOf(cleaned[i + 1]);
|
|
199
|
+
const c = cleaned[i + 2] === '=' ? 0 : BASE64_CHARS.indexOf(cleaned[i + 2]);
|
|
200
|
+
const d = cleaned[i + 3] === '=' ? 0 : BASE64_CHARS.indexOf(cleaned[i + 3]);
|
|
201
|
+
const bits = a << 18 | b << 12 | c << 6 | d;
|
|
202
|
+
if (p < byteLen) bytes[p++] = bits >> 16 & 0xff;
|
|
203
|
+
if (p < byteLen) bytes[p++] = bits >> 8 & 0xff;
|
|
204
|
+
if (p < byteLen) bytes[p++] = bits & 0xff;
|
|
205
|
+
}
|
|
206
|
+
return bytes;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Analyze an RSA key PEM string and return metadata about it.
|
|
211
|
+
* Runs entirely in JS — no native bridge call needed.
|
|
212
|
+
*/
|
|
213
|
+
export function getKeyInfo(keyString) {
|
|
214
|
+
const errors = [];
|
|
215
|
+
let format = 'unknown';
|
|
216
|
+
let keyType = 'unknown';
|
|
217
|
+
let base64Content = '';
|
|
218
|
+
let base64Lines = [];
|
|
219
|
+
if (keyString.includes(PEM_HEADERS.pkcs1Private) && keyString.includes(PEM_HEADERS.pkcs1PrivateEnd)) {
|
|
220
|
+
format = 'pkcs1';
|
|
221
|
+
keyType = 'private';
|
|
222
|
+
const start = keyString.indexOf(PEM_HEADERS.pkcs1Private) + PEM_HEADERS.pkcs1Private.length;
|
|
223
|
+
const end = keyString.indexOf(PEM_HEADERS.pkcs1PrivateEnd);
|
|
224
|
+
const raw = keyString.substring(start, end).trim();
|
|
225
|
+
base64Lines = raw.split('\n').map(l => l.trim()).filter(l => l.length > 0);
|
|
226
|
+
base64Content = raw.replace(/\s/g, '');
|
|
227
|
+
} else if (keyString.includes(PEM_HEADERS.pkcs8Private) && keyString.includes(PEM_HEADERS.pkcs8PrivateEnd)) {
|
|
228
|
+
format = 'pkcs8';
|
|
229
|
+
keyType = 'private';
|
|
230
|
+
const start = keyString.indexOf(PEM_HEADERS.pkcs8Private) + PEM_HEADERS.pkcs8Private.length;
|
|
231
|
+
const end = keyString.indexOf(PEM_HEADERS.pkcs8PrivateEnd);
|
|
232
|
+
const raw = keyString.substring(start, end).trim();
|
|
233
|
+
base64Lines = raw.split('\n').map(l => l.trim()).filter(l => l.length > 0);
|
|
234
|
+
base64Content = raw.replace(/\s/g, '');
|
|
235
|
+
} else if (keyString.includes(PEM_HEADERS.public) && keyString.includes(PEM_HEADERS.publicEnd)) {
|
|
236
|
+
format = 'public';
|
|
237
|
+
keyType = 'public';
|
|
238
|
+
const start = keyString.indexOf(PEM_HEADERS.public) + PEM_HEADERS.public.length;
|
|
239
|
+
const end = keyString.indexOf(PEM_HEADERS.publicEnd);
|
|
240
|
+
const raw = keyString.substring(start, end).trim();
|
|
241
|
+
base64Lines = raw.split('\n').map(l => l.trim()).filter(l => l.length > 0);
|
|
242
|
+
base64Content = raw.replace(/\s/g, '');
|
|
243
|
+
} else {
|
|
244
|
+
errors.push('Missing or invalid PEM headers');
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Validate line formatting (PEM standard: 64 chars per line)
|
|
248
|
+
if (base64Lines.length > 0) {
|
|
249
|
+
for (let i = 0; i < base64Lines.length - 1; i++) {
|
|
250
|
+
if (base64Lines[i].length !== 64) {
|
|
251
|
+
errors.push(`Line ${i + 1} has ${base64Lines[i].length} chars, expected 64`);
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
const lastLine = base64Lines[base64Lines.length - 1];
|
|
256
|
+
if (lastLine.length > 64) {
|
|
257
|
+
errors.push(`Last line has ${lastLine.length} chars, expected <= 64`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Decode and validate structure
|
|
262
|
+
let derBytes = null;
|
|
263
|
+
if (base64Content.length > 0) {
|
|
264
|
+
try {
|
|
265
|
+
derBytes = base64Decode(base64Content);
|
|
266
|
+
} catch {
|
|
267
|
+
errors.push('Invalid base64 encoding');
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (derBytes && format === 'pkcs1') {
|
|
271
|
+
errors.push(...validatePKCS1Structure(derBytes));
|
|
272
|
+
} else if (derBytes && format === 'pkcs8') {
|
|
273
|
+
errors.push(...validatePKCS8Structure(derBytes));
|
|
274
|
+
} else if (derBytes && format === 'public') {
|
|
275
|
+
errors.push(...validateSPKIStructure(derBytes));
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
isValid: errors.length === 0,
|
|
279
|
+
format,
|
|
280
|
+
keyType,
|
|
281
|
+
pemLineCount: base64Lines.length,
|
|
282
|
+
derByteLength: derBytes?.length ?? 0,
|
|
283
|
+
errors
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
//# sourceMappingURL=keyInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PEM_HEADERS","pkcs1Private","pkcs1PrivateEnd","pkcs8Private","pkcs8PrivateEnd","public","publicEnd","parseASN1Length","bytes","offset","length","bytesRead","firstByte","numLengthBytes","i","validatePKCS1Structure","derBytes","errors","push","toString","seqLength","integerCount","tempOffset","endOffset","intLength","intBytesRead","validatePKCS8Structure","verLen","verBytesRead","algLen","algBytesRead","validateSPKIStructure","BASE64_CHARS","base64Decode","input","cleaned","replace","len","byteLen","endsWith","Uint8Array","p","a","indexOf","b","c","d","bits","getKeyInfo","keyString","format","keyType","base64Content","base64Lines","includes","start","end","raw","substring","trim","split","map","l","filter","lastLine","isValid","pemLineCount","derByteLength"],"sourceRoot":"../../src","sources":["keyInfo.ts"],"mappings":";;AAEA,MAAMA,WAAW,GAAG;EAClBC,YAAY,EAAE,iCAAiC;EAC/CC,eAAe,EAAE,+BAA+B;EAChDC,YAAY,EAAE,6BAA6B;EAC3CC,eAAe,EAAE,2BAA2B;EAC5CC,MAAM,EAAE,4BAA4B;EACpCC,SAAS,EAAE;AACb,CAAC;AAED,SAASC,eAAeA,CACtBC,KAAiB,EACjBC,MAAc,EACgC;EAC9C,IAAIA,MAAM,IAAID,KAAK,CAACE,MAAM,EAAE;IAC1B,OAAO;MAAEA,MAAM,EAAE,IAAI;MAAEC,SAAS,EAAE;IAAE,CAAC;EACvC;EACA,MAAMC,SAAS,GAAGJ,KAAK,CAACC,MAAM,CAAE;EAChC,IAAIG,S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,CAACtD,MAAM,wBAAwB,CAAC;IACvE;EACF;;EAEA;EACA,IAAIM,QAA2B,GAAG,IAAI;EACtC,IAAIoC,aAAa,CAAC1C,MAAM,GAAG,CAAC,EAAE;IAC5B,IAAI;MACFM,QAAQ,GAAGiB,YAAY,CAACmB,aAAa,CAAC;IACxC,CAAC,CAAC,MAAM;MACNnC,MAAM,CAACC,IAAI,CAAC,yBAAyB,CAAC;IACxC;EACF;EAEA,IAAIF,QAAQ,IAAIkC,MAAM,KAAK,OAAO,EAAE;IAClCjC,MAAM,CAACC,IAAI,CAAC,GAAGH,sBAAsB,CAACC,QAAQ,CAAC,CAAC;EAClD,CAAC,MAAM,IAAIA,QAAQ,IAAIkC,MAAM,KAAK,OAAO,EAAE;IACzCjC,MAAM,CAACC,IAAI,CAAC,GAAGQ,sBAAsB,CAACV,QAAQ,CAAC,CAAC;EAClD,CAAC,MAAM,IAAIA,QAAQ,IAAIkC,MAAM,KAAK,QAAQ,EAAE;IAC1CjC,MAAM,CAACC,IAAI,CAAC,GAAGa,qBAAqB,CAACf,QAAQ,CAAC,CAAC;EACjD;EAEA,OAAO;IACLiD,OAAO,EAAEhD,MAAM,CAACP,MAAM,KAAK,CAAC;IAC5BwC,MAAM;IACNC,OAAO;IACPe,YAAY,EAAEb,WAAW,CAAC3C,MAAM;IAChCyD,aAAa,EAAEnD,QAAQ,EAAEN,MAAM,IAAI,CAAC;IACpCO;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Native bridge specification for RSA operations.
|
|
4
|
+
*
|
|
5
|
+
* All methods use flat string parameters (no objects/arrays) because
|
|
6
|
+
* React Native's codegen works best with simple types across the bridge.
|
|
7
|
+
*
|
|
8
|
+
* Data is passed as base64 strings to avoid binary encoding issues.
|
|
9
|
+
* The JS layer (index.ts) handles defaults resolution and UTF-8→base64 encoding.
|
|
10
|
+
*/
|
|
11
|
+
export interface Spec extends TurboModule {
|
|
12
|
+
/** Generate an RSA key pair → { publicKey, privateKey } in PEM format */
|
|
13
|
+
generateKeyPair(keySize: number, format: string): Promise<{
|
|
14
|
+
publicKey: string;
|
|
15
|
+
privateKey: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** Extract public key from a private key PEM → public key PEM */
|
|
18
|
+
getPublicKeyFromPrivate(privateKeyPEM: string): Promise<string>;
|
|
19
|
+
/** Encrypt base64 data with a public key → base64 ciphertext */
|
|
20
|
+
encrypt(dataBase64: string, publicKeyPEM: string, padding: string, hash: string): Promise<string>;
|
|
21
|
+
/** Decrypt base64 ciphertext with a private key → base64 plaintext */
|
|
22
|
+
decrypt(dataBase64: string, privateKeyPEM: string, padding: string, hash: string): Promise<string>;
|
|
23
|
+
/** Sign base64 data with a private key → base64 signature */
|
|
24
|
+
sign(dataBase64: string, privateKeyPEM: string, padding: string, hash: string): Promise<string>;
|
|
25
|
+
/** Verify a base64 signature against base64 data → boolean */
|
|
26
|
+
verify(dataBase64: string, signatureBase64: string, publicKeyPEM: string, padding: string, hash: string): Promise<boolean>;
|
|
27
|
+
/** Convert a private key PEM between PKCS#1 and PKCS#8 formats */
|
|
28
|
+
convertPrivateKey(pem: string, targetFormat: string): Promise<string>;
|
|
29
|
+
}
|
|
30
|
+
declare const _default: Spec;
|
|
31
|
+
export default _default;
|
|
32
|
+
//# sourceMappingURL=NativeRsa.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeRsa.d.ts","sourceRoot":"","sources":["../../../src/NativeRsa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,M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` when the caller omits an option.
|
|
5
|
+
* Keeping them in one place ensures consistency across encrypt, decrypt, sign, verify.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULTS: {
|
|
8
|
+
/** Default padding for encrypt/decrypt — OAEP is recommended over PKCS#1 */
|
|
9
|
+
ENCRYPTION_PADDING: "oaep";
|
|
10
|
+
/** Default padding for sign/verify — PSS is recommended over PKCS#1 */
|
|
11
|
+
SIGNATURE_PADDING: "pss";
|
|
12
|
+
/** Default hash algorithm */
|
|
13
|
+
HASH: "sha256";
|
|
14
|
+
/** Default input string encoding — UTF-8 text is the common case */
|
|
15
|
+
ENCODING: "utf8";
|
|
16
|
+
/** Default private key format for key generation */
|
|
17
|
+
KEY_FORMAT: "pkcs1";
|
|
18
|
+
};
|
|
19
|
+
/** Supported RSA key sizes in bits */
|
|
20
|
+
export declare const VALID_KEY_SIZES: readonly [1024, 2048, 4096];
|
|
21
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;IACnB,4EAA4E;;IAG5E,uEAAuE;;IAGvE,6BAA6B;;IAG7B,oEAAoE;;IAGpE,oDAAoD;;CAErD,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,eAAe,6BAA8B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure-JS UTF-8 ↔ Base64 encoding utilities.
|
|
3
|
+
*
|
|
4
|
+
* These work in all React Native JS engines (Hermes, JSC) without
|
|
5
|
+
* external dependencies. They handle full Unicode including surrogate pairs.
|
|
6
|
+
*
|
|
7
|
+
* Used by the public API to convert UTF-8 input strings to base64
|
|
8
|
+
* before sending them across the native bridge.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Encode a UTF-8 string to base64.
|
|
12
|
+
*
|
|
13
|
+
* Steps:
|
|
14
|
+
* 1. Convert the JS string (UTF-16) to UTF-8 byte values
|
|
15
|
+
* 2. Encode those bytes as base64
|
|
16
|
+
*
|
|
17
|
+
* Handles multi-byte characters and surrogate pairs correctly.
|
|
18
|
+
*/
|
|
19
|
+
export declare function utf8ToBase64(str: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Decode a base64 string to a UTF-8 string.
|
|
22
|
+
*
|
|
23
|
+
* Steps:
|
|
24
|
+
* 1. Decode base64 → raw byte values
|
|
25
|
+
* 2. Interpret those bytes as UTF-8 and build a JS string
|
|
26
|
+
*
|
|
27
|
+
* Useful for reading decrypted plaintext that was originally UTF-8 text.
|
|
28
|
+
*/
|
|
29
|
+
export declare function base64ToUtf8(base64: string): string;
|
|
30
|
+
//# sourceMappingURL=encoding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/encoding.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgDhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAyDnD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error codes thrown by @avieldr/react-native-rsa.
|
|
3
|
+
*
|
|
4
|
+
* Validation errors (thrown before native call):
|
|
5
|
+
* - INVALID_INPUT: Required parameter is missing or empty
|
|
6
|
+
* - INVALID_KEY: Key format is wrong or key type mismatch
|
|
7
|
+
* - INVALID_KEY_SIZE: Unsupported key size
|
|
8
|
+
* - INVALID_PADDING: Unknown padding mode
|
|
9
|
+
* - INVALID_HASH: Unknown hash algorithm
|
|
10
|
+
* - INVALID_FORMAT: Unknown key format
|
|
11
|
+
* - INVALID_ENCODING: Unknown encoding type
|
|
12
|
+
*
|
|
13
|
+
* Native operation errors (thrown by platform crypto):
|
|
14
|
+
* - KEY_GENERATION_FAILED: Native key generation failed
|
|
15
|
+
* - KEY_EXTRACTION_FAILED: Failed to extract public key from private
|
|
16
|
+
* - KEY_CONVERSION_FAILED: Failed to convert key format
|
|
17
|
+
* - ENCRYPTION_FAILED: Native encryption operation failed
|
|
18
|
+
* - DECRYPTION_FAILED: Native decryption operation failed
|
|
19
|
+
* - SIGNING_FAILED: Native signing operation failed
|
|
20
|
+
* - VERIFICATION_FAILED: Native signature verification failed
|
|
21
|
+
*/
|
|
22
|
+
export type RsaErrorCode = 'INVALID_INPUT' | 'INVALID_KEY' | 'INVALID_KEY_SIZE' | 'INVALID_PADDING' | 'INVALID_HASH' | 'INVALID_FORMAT' | 'INVALID_ENCODING' | 'KEY_GENERATION_FAILED' | 'KEY_EXTRACTION_FAILED' | 'KEY_CONVERSION_FAILED' | 'ENCRYPTION_FAILED' | 'DECRYPTION_FAILED' | 'SIGNING_FAILED' | 'VERIFICATION_FAILED';
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown by @avieldr/react-native-rsa for invalid inputs or native failures.
|
|
25
|
+
* Extends Error with a `code` property for programmatic handling.
|
|
26
|
+
*/
|
|
27
|
+
export declare class RsaError extends Error {
|
|
28
|
+
readonly code: RsaErrorCode;
|
|
29
|
+
/** The original error from the native layer, if any */
|
|
30
|
+
readonly cause?: Error;
|
|
31
|
+
constructor(code: RsaErrorCode, message: string, cause?: Error);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Wrap a native error into an RsaError with a normalized code.
|
|
35
|
+
* If the error is already an RsaError, returns it unchanged.
|
|
36
|
+
*/
|
|
37
|
+
export declare function wrapNativeError(error: unknown, fallbackCode: RsaErrorCode): RsaError;
|
|
38
|
+
export declare function requireString(value: unknown, name: string): asserts value is string;
|
|
39
|
+
export declare function requirePrivateKey(pem: string): void;
|
|
40
|
+
export declare function requirePublicKey(pem: string): void;
|
|
41
|
+
export declare function validateKeySize(keySize: number): void;
|
|
42
|
+
export declare function validateEncryptionPadding(padding: string): void;
|
|
43
|
+
export declare function validateSignaturePadding(padding: string): void;
|
|
44
|
+
export declare function validateHash(hash: string): void;
|
|
45
|
+
export declare function validateKeyFormat(format: string): void;
|
|
46
|
+
export declare function validateEncoding(encoding: string): void;
|
|
47
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,YAAY,GAEpB,eAAe,GACf,aAAa,GACb,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAElB,uBAAuB,GACvB,uBAAuB,GACvB,uBAAuB,GACvB,mBAAmB,GACnB,mBAAmB,GACnB,gBAAgB,GAChB,qBAAqB,CAAC;AAE1B;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEX,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM/D;AAgBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,GAAG,QAAQ,CAcpF;AAID,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,MAAM,CAIzB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAmBnD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAiBlD;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAOrD;AAID,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAO/D;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAO9D;AAID,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAO/C;AAID,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAOtD;AAID,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAOvD"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { getKeyInfo } from './keyInfo';
|
|
2
|
+
import type { RSAKeyPair, GenerateKeyPairOptions, KeyFormat, EncryptOptions, DecryptOptions, SignOptions, VerifyOptions } from './types';
|
|
3
|
+
export type { RSAKeyPair, GenerateKeyPairOptions, RSAKeyInfo, KeyFormat, EncryptOptions, DecryptOptions, SignOptions, VerifyOptions, EncryptionPadding, SignaturePadding, HashAlgorithm, InputEncoding, } from './types';
|
|
4
|
+
export { RsaError, type RsaErrorCode } from './errors';
|
|
5
|
+
export { getKeyInfo } from './keyInfo';
|
|
6
|
+
export { utf8ToBase64, base64ToUtf8 } from './encoding';
|
|
7
|
+
/**
|
|
8
|
+
* Generate an RSA key pair (public + private) using native platform crypto.
|
|
9
|
+
*
|
|
10
|
+
* @param keySize RSA key size in bits. Default: 2048. Supported: 1024, 2048, 4096.
|
|
11
|
+
* @param options Optional configuration (format: 'pkcs1' | 'pkcs8')
|
|
12
|
+
* @returns Object with publicKey and privateKey in PEM format
|
|
13
|
+
* @throws {RsaError} INVALID_KEY_SIZE if keySize is not 1024, 2048, or 4096
|
|
14
|
+
* @throws {RsaError} INVALID_FORMAT if options.format is not 'pkcs1' or 'pkcs8'
|
|
15
|
+
* @throws {RsaError} KEY_GENERATION_FAILED if native key generation fails
|
|
16
|
+
*/
|
|
17
|
+
declare function generateKeyPair(keySize?: number, options?: GenerateKeyPairOptions): Promise<RSAKeyPair>;
|
|
18
|
+
/**
|
|
19
|
+
* Extract the public key from an RSA private key PEM string.
|
|
20
|
+
*
|
|
21
|
+
* @param privateKeyPEM RSA private key in PEM format (PKCS#1 or PKCS#8)
|
|
22
|
+
* @returns Public key in PEM format (SPKI/X.509)
|
|
23
|
+
* @throws {RsaError} INVALID_INPUT if privateKeyPEM is empty
|
|
24
|
+
* @throws {RsaError} INVALID_KEY if privateKeyPEM is not a valid private key
|
|
25
|
+
* @throws {RsaError} KEY_EXTRACTION_FAILED if native operation fails
|
|
26
|
+
*/
|
|
27
|
+
declare function getPublicKeyFromPrivate(privateKeyPEM: string): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Encrypt plaintext with an RSA public key.
|
|
30
|
+
*
|
|
31
|
+
* The input string is UTF-8 encoded to base64 by default before sending to native.
|
|
32
|
+
* Set `options.encoding = 'base64'` if the input is already base64-encoded binary.
|
|
33
|
+
*
|
|
34
|
+
* @param data The plaintext to encrypt (UTF-8 string or base64, depending on encoding option)
|
|
35
|
+
* @param publicKeyPEM The public key in SPKI PEM format
|
|
36
|
+
* @param options Padding, hash, and encoding options (defaults: oaep, sha256, utf8)
|
|
37
|
+
* @returns Base64-encoded ciphertext
|
|
38
|
+
* @throws {RsaError} INVALID_INPUT if data or publicKeyPEM is empty
|
|
39
|
+
* @throws {RsaError} INVALID_KEY if publicKeyPEM is not a valid public key
|
|
40
|
+
* @throws {RsaError} INVALID_PADDING if options.padding is invalid
|
|
41
|
+
* @throws {RsaError} INVALID_HASH if options.hash is invalid
|
|
42
|
+
* @throws {RsaError} INVALID_ENCODING if options.encoding is invalid
|
|
43
|
+
* @throws {RsaError} ENCRYPTION_FAILED if native encryption fails
|
|
44
|
+
*/
|
|
45
|
+
declare function encrypt(data: string, publicKeyPEM: string, options?: EncryptOptions): Promise<string>;
|
|
46
|
+
/**
|
|
47
|
+
* Decrypt ciphertext with an RSA private key.
|
|
48
|
+
*
|
|
49
|
+
* Always returns base64-encoded plaintext. If the original data was UTF-8 text,
|
|
50
|
+
* use `base64ToUtf8()` to decode the result.
|
|
51
|
+
*
|
|
52
|
+
* @param encrypted Base64-encoded ciphertext (from encrypt())
|
|
53
|
+
* @param privateKeyPEM The private key in PEM format (PKCS#1 or PKCS#8)
|
|
54
|
+
* @param options Padding and hash options — must match what was used for encryption
|
|
55
|
+
* @returns Base64-encoded decrypted plaintext
|
|
56
|
+
* @throws {RsaError} INVALID_INPUT if encrypted or privateKeyPEM is empty
|
|
57
|
+
* @throws {RsaError} INVALID_KEY if privateKeyPEM is not a valid private key
|
|
58
|
+
* @throws {RsaError} INVALID_PADDING if options.padding is invalid
|
|
59
|
+
* @throws {RsaError} INVALID_HASH if options.hash is invalid
|
|
60
|
+
* @throws {RsaError} DECRYPTION_FAILED if native decryption fails
|
|
61
|
+
*/
|
|
62
|
+
declare function decrypt(encrypted: string, privateKeyPEM: string, options?: DecryptOptions): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Sign data with an RSA private key.
|
|
65
|
+
*
|
|
66
|
+
* The input string is UTF-8 encoded to base64 by default before sending to native.
|
|
67
|
+
* Set `options.encoding = 'base64'` if the input is already base64-encoded binary.
|
|
68
|
+
*
|
|
69
|
+
* @param data The data to sign (UTF-8 string or base64, depending on encoding option)
|
|
70
|
+
* @param privateKeyPEM The private key in PEM format (PKCS#1 or PKCS#8)
|
|
71
|
+
* @param options Padding, hash, and encoding options (defaults: pss, sha256, utf8)
|
|
72
|
+
* @returns Base64-encoded signature
|
|
73
|
+
* @throws {RsaError} INVALID_INPUT if data or privateKeyPEM is empty
|
|
74
|
+
* @throws {RsaError} INVALID_KEY if privateKeyPEM is not a valid private key
|
|
75
|
+
* @throws {RsaError} INVALID_PADDING if options.padding is invalid
|
|
76
|
+
* @throws {RsaError} INVALID_HASH if options.hash is invalid
|
|
77
|
+
* @throws {RsaError} INVALID_ENCODING if options.encoding is invalid
|
|
78
|
+
* @throws {RsaError} SIGNING_FAILED if native signing fails
|
|
79
|
+
*/
|
|
80
|
+
declare function sign(data: string, privateKeyPEM: string, options?: SignOptions): Promise<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Verify a signature against data using an RSA public key.
|
|
83
|
+
*
|
|
84
|
+
* The input string encoding must match what was used during signing.
|
|
85
|
+
*
|
|
86
|
+
* @param data The original data that was signed
|
|
87
|
+
* @param signature Base64-encoded signature (from sign())
|
|
88
|
+
* @param publicKeyPEM The public key in SPKI PEM format
|
|
89
|
+
* @param options Padding, hash, and encoding options — must match signing options
|
|
90
|
+
* @returns true if the signature is valid, false otherwise
|
|
91
|
+
* @throws {RsaError} INVALID_INPUT if data, signature, or publicKeyPEM is empty
|
|
92
|
+
* @throws {RsaError} INVALID_KEY if publicKeyPEM is not a valid public key
|
|
93
|
+
* @throws {RsaError} INVALID_PADDING if options.padding is invalid
|
|
94
|
+
* @throws {RsaError} INVALID_HASH if options.hash is invalid
|
|
95
|
+
* @throws {RsaError} INVALID_ENCODING if options.encoding is invalid
|
|
96
|
+
* @throws {RsaError} VERIFICATION_FAILED if native verification fails
|
|
97
|
+
*/
|
|
98
|
+
declare function verify(data: string, signature: string, publicKeyPEM: string, options?: VerifyOptions): Promise<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* Convert a private key PEM between PKCS#1 and PKCS#8 formats.
|
|
101
|
+
*
|
|
102
|
+
* @param pem The private key in PEM format
|
|
103
|
+
* @param targetFormat 'pkcs1' or 'pkcs8'
|
|
104
|
+
* @returns The private key re-encoded in the target format
|
|
105
|
+
* @throws {RsaError} INVALID_INPUT if pem is empty
|
|
106
|
+
* @throws {RsaError} INVALID_KEY if pem is not a valid private key
|
|
107
|
+
* @throws {RsaError} INVALID_FORMAT if targetFormat is invalid
|
|
108
|
+
* @throws {RsaError} KEY_CONVERSION_FAILED if native conversion fails
|
|
109
|
+
*/
|
|
110
|
+
declare function convertPrivateKey(pem: string, targetFormat: KeyFormat): Promise<string>;
|
|
111
|
+
declare const RSA: {
|
|
112
|
+
generateKeyPair: typeof generateKeyPair;
|
|
113
|
+
getPublicKeyFromPrivate: typeof getPublicKeyFromPrivate;
|
|
114
|
+
getKeyInfo: typeof getKeyInfo;
|
|
115
|
+
encrypt: typeof encrypt;
|
|
116
|
+
decrypt: typeof decrypt;
|
|
117
|
+
sign: typeof sign;
|
|
118
|
+
verify: typeof verify;
|
|
119
|
+
convertPrivateKey: typeof convertPrivateKey;
|
|
120
|
+
};
|
|
121
|
+
export default RSA;
|
|
122
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAevC,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAIxD;;;;;;;;;GASG;AACH,iBAAe,eAAe,CAC5B,OAAO,GAAE,MAAa,EACtB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,UAAU,CAAC,CAUrB;AAED;;;;;;;;GAQG;AACH,iBAAe,uBAAuB,CACpC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAe,OAAO,CACpB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAe,OAAO,CACpB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAejB;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAe,IAAI,CACjB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAe,MAAM,CACnB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,OAAO,CAAC,CAoBlB;AAID;;;;;;;;;;GAUG;AACH,iBAAe,iBAAiB,CAC9B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,SAAS,GACtB,OAAO,CAAC,MAAM,CAAC,CASjB;AAID,QAAA,MAAM,GAAG;;;;;;;;;CASR,CAAC;AACF,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RSAKeyInfo } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Analyze an RSA key PEM string and return metadata about it.
|
|
4
|
+
* Runs entirely in JS — no native bridge call needed.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getKeyInfo(keyString: string): RSAKeyInfo;
|
|
7
|
+
//# sourceMappingURL=keyInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyInfo.d.ts","sourceRoot":"","sources":["../../../src/keyInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAqO1C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAoGxD"}
|