summaryrefslogtreecommitdiff
path: root/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-10-24 17:43:37 +0200
committerRaindropsSys <raindrops@equestria.dev>2023-10-24 17:43:37 +0200
commitae187b6d75c8079da0be1dc288613bad8466fe61 (patch)
tree5ea0d34185a2270f29ffaa65e1f5258028d7d5d0 /desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js
downloadmist-ae187b6d75c8079da0be1dc288613bad8466fe61.tar.gz
mist-ae187b6d75c8079da0be1dc288613bad8466fe61.tar.bz2
mist-ae187b6d75c8079da0be1dc288613bad8466fe61.zip
Initial commit
Diffstat (limited to 'desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js')
-rw-r--r--desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js
new file mode 100644
index 0000000..4fb273d
--- /dev/null
+++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js
@@ -0,0 +1,30 @@
+import { debugLog, compactFlattenedList, execFileAsync } from './util';
+export class Identity {
+ constructor(name, hash) {
+ this.name = name;
+ this.hash = hash;
+ }
+}
+export async function findIdentities(keychain, identity) {
+ // Only to look for valid identities, excluding those flagged with
+ // CSSMERR_TP_CERT_EXPIRED or CSSMERR_TP_NOT_TRUSTED. Fixes #9
+ const args = [
+ 'find-identity',
+ '-v'
+ ];
+ if (keychain) {
+ args.push(keychain);
+ }
+ const result = await execFileAsync('security', args);
+ const identities = result.split('\n').map(function (line) {
+ if (line.indexOf(identity) >= 0) {
+ const identityFound = line.substring(line.indexOf('"') + 1, line.lastIndexOf('"'));
+ const identityHashFound = line.substring(line.indexOf(')') + 2, line.indexOf('"') - 1);
+ debugLog('Identity:', '\n', '> Name:', identityFound, '\n', '> Hash:', identityHashFound);
+ return new Identity(identityFound, identityHashFound);
+ }
+ return null;
+ });
+ return compactFlattenedList(identities);
+}
+//# sourceMappingURL=util-identities.js.map \ No newline at end of file