File tree Expand file tree Collapse file tree 5 files changed +19
-12
lines changed Expand file tree Collapse file tree 5 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -122,17 +122,6 @@ - (id)initWithClientId:(NSNumber *)clientID
122122 return self;
123123}
124124
125- - (void )dealloc {
126- if (_clientIdentity) {
127- CFRelease (_clientIdentity);
128- _clientIdentity = NULL ;
129- }
130- if (_peerTrust) {
131- CFRelease (_peerTrust);
132- _peerTrust = NULL ;
133- }
134- }
135-
136125- (BOOL )connect : (NSString *)host
137126 port : (int )port
138127 withOptions : (NSDictionary *)options
Original file line number Diff line number Diff line change 1111 * @extends {Socket }
1212 */
1313export default class TLSSocket extends Socket {
14+ /**
15+ * Checks if a certificate identity exists in the keychain
16+ * @param {object } options Object containing the identity aliases
17+ * @param {string } [options.androidKeyStore] The android keystore type
18+ * @param {string } [options.certAlias] The certificate alias
19+ * @param {string } [options.keyAlias] The key alias
20+ * @returns {Promise<boolean> } Promise resolving to true if identity exists
21+ */
22+ static hasIdentity ( options ?: {
23+ androidKeyStore : string | undefined ;
24+ certAlias : string | undefined ;
25+ keyAlias : string | undefined ;
26+ } ) : Promise < boolean > ;
1427 /**
1528 * @private
1629 * Resolves the asset source if necessary and registers the resolved key.
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ declare namespace _default {
1111 export { Socket } ;
1212 export { TLSServer } ;
1313 export { TLSSocket } ;
14+ export const hasIdentity : typeof import ( "./TLSSocket" ) . default . hasIdentity ;
1415}
1516export default _default ;
1617/**
Original file line number Diff line number Diff line change @@ -69,14 +69,16 @@ export default class TLSSocket extends Socket {
6969 /**
7070 * Checks if a certificate identity exists in the keychain
7171 * @param {object } options Object containing the identity aliases
72+ * @param {string } [options.androidKeyStore] The android keystore type
7273 * @param {string } [options.certAlias] The certificate alias
7374 * @param {string } [options.keyAlias] The key alias
7475 * @returns {Promise<boolean> } Promise resolving to true if identity exists
7576 */
7677 static hasIdentity ( options = { } ) {
7778 return Sockets . hasIdentity ( {
79+ androidKeyStore : options . androidKeyStore ,
7880 certAlias : options . certAlias ,
79- keyAlias : options . keyAlias
81+ keyAlias : options . keyAlias ,
8082 } ) ;
8183 }
8284
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ export default {
112112 Socket,
113113 TLSServer,
114114 TLSSocket,
115+ hasIdentity : TLSSocket . hasIdentity ,
115116} ;
116117
117118// @ts -ignore
@@ -128,4 +129,5 @@ module.exports = {
128129 Socket,
129130 TLSServer,
130131 TLSSocket,
132+ hasIdentity : TLSSocket . hasIdentity ,
131133} ;
You can’t perform that action at this time.
0 commit comments