File tree 5 files changed +47
-7
lines changed
raw-rsa-keyring-browser/test
5 files changed +47
-7
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export function fourEdksMessage() {
74
74
return 'AYAAFO/VP38MeBJoKQshvIaF8TgAAAAEAAR0ZW1wABhrZXkzAAAAgAAAAAzIotUMc7SaFTbzk0EAIKgxmVzmYedtQj5od6KglliFAx7G3OBYHMgyvbGQVJSyAAR0ZW1wABhrZXkwAAAAgAAAAAwBe+86+eb8+uYOeoIAIFmT8yZvThnsJigzsRen9OJc0kuGE+rJyalk+yF5VdNBAAR0ZW1wABhrZXkyAAAAgAAAAAy939QOrzUF3XKc0m8AICSGMg1tdgULYD15Jr7RWkFgqCXjtwyUK86xqrU+OzV9AAR0ZW1wABhrZXkxAAAAgAAAAAxE6lJVWjxWLtvnkBYAIJUl4vhbLEjNS/3g3of4T/QvAR7TGPJZgv7cLqOP0T7uAgAAAAAMAAAQAAAAAAAAAAAAAAAAAOMcqPpQVjBzbYAHIPjMM1T/////AAAAAQAAAAAAAAAAAAAAAQAAAAQPcr1WkUGY1IDMmCgdibk0zwg4Yg=='
75
75
}
76
76
77
- export function decryptKeyring ( ) {
77
+ export function decryptKeyring ( ) : KeyringNode {
78
78
class TestKeyring extends KeyringNode {
79
79
async _onEncrypt ( ) : Promise < NodeEncryptionMaterial > {
80
80
throw new Error ( 'I should never see this error' )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ const { encrypt, decrypt } = buildClient(
36
36
*/
37
37
// @ts -ignore
38
38
import { subtle } from './msrcrypto'
39
- configureFallback ( subtle ) . catch ( ( e ) => {
39
+ configureFallback ( subtle as SubtleCrypto ) . catch ( ( e ) => {
40
40
throw e
41
41
} )
42
42
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ if (!existsSync(fixtures)) {
92
92
slice,
93
93
karma,
94
94
concurrency,
95
- } = argv
95
+ } = await argv
96
96
97
97
writeFileSync ( `${ fixtures } /decrypt_tests.json` , JSON . stringify ( [ ] ) )
98
98
writeFileSync ( `${ fixtures } /encrypt_tests.json` , JSON . stringify ( [ ] ) )
Original file line number Diff line number Diff line change @@ -100,8 +100,16 @@ export interface AwsEsdkKeyObject {
100
100
* bytes. This property is `undefined` for symmetric keys.
101
101
*/
102
102
asymmetricKeySize ?: number
103
+ /**
104
+ * This property exists only on asymmetric keys. Depending on the type of the key,
105
+ * this object contains information about the key. None of the information obtained
106
+ * through this property can be used to uniquely identify a key or to compromise the
107
+ * security of the key.
108
+ */
109
+ asymmetricKeyDetails ?: AwsEsdkAsymmetricKeyDetails
103
110
export ( options : AwsEsdkKeyExportOptions < 'pem' > ) : string | Buffer
104
111
export ( options ?: AwsEsdkKeyExportOptions < 'der' > ) : Buffer
112
+ export ( options ?: { format : 'jwk' } ) : AwsEsdkJsonWebKey
105
113
symmetricSize ?: number
106
114
type : AwsEsdkKeyObjectType
107
115
}
@@ -113,3 +121,38 @@ export interface ClientOptions {
113
121
}
114
122
115
123
export type Newable < T > = { new ( ...args : any [ ] ) : T }
124
+
125
+ export interface AwsEsdkJsonWebKey {
126
+ crv ?: string
127
+ d ?: string
128
+ dp ?: string
129
+ dq ?: string
130
+ e ?: string
131
+ k ?: string
132
+ kty ?: string
133
+ n ?: string
134
+ p ?: string
135
+ q ?: string
136
+ qi ?: string
137
+ x ?: string
138
+ y ?: string
139
+ [ key : string ] : unknown
140
+ }
141
+ export interface AwsEsdkAsymmetricKeyDetails {
142
+ /**
143
+ * Key size in bits (RSA, DSA).
144
+ */
145
+ modulusLength ?: number
146
+ /**
147
+ * Public exponent (RSA).
148
+ */
149
+ publicExponent ?: bigint
150
+ /**
151
+ * Size of q in bits (DSA).
152
+ */
153
+ divisorLength ?: number
154
+ /**
155
+ * Name of the curve (EC).
156
+ */
157
+ namedCurve ?: string
158
+ }
Original file line number Diff line number Diff line change 5
5
6
6
import * as chai from 'chai'
7
7
import chaiAsPromised from 'chai-as-promised'
8
- import {
9
- RsaImportableKey ,
10
- RawRsaKeyringWebCrypto ,
11
- } from '@aws-crypto/raw-rsa-keyring-browser'
8
+ import { RsaImportableKey , RawRsaKeyringWebCrypto } from '../src/index'
12
9
import {
13
10
KeyringWebCrypto ,
14
11
WebCryptoEncryptionMaterial ,
You can’t perform that action at this time.
0 commit comments