UNPKG

15.4 kBHTMLView Raw
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>JSDoc: Module: localKeyUtil</title>
6
7 <script src="scripts/prettify/prettify.js"> </script>
8 <script src="scripts/prettify/lang-css.js"> </script>
9 <!--[if lt IE 9]>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11 <![endif]-->
12 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13 <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14</head>
15
16<body>
17
18<div id="main">
19
20 <h1 class="page-title">Module: localKeyUtil</h1>
21
22
23
24
25
26
27<section>
28
29<header>
30
31
32
33
34
35</header>
36
37<article>
38 <div class="container-overview">
39
40
41 <div class="description"><p>This routines are utilities for setting up public/private keys.</p>
42<p>These routines are meant to be used locally on a BIG-IP and operate via tmsh
43rather than iControl REST. This is so that we do not need to take in
44unencrypted passwords as parameters either on the command line or via
45the filesystem.</p>
46<p>Notes:</p>
47<ul>
48<li>Only runs locally on a BIG-IP. Cannot run on a remote BIG-IP.</li>
49<li>Uses tmsh rather than iControl REST so that we do not need to take in a password</li>
50</ul></div>
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70<dl class="details">
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103</dl>
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124 </div>
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141 <h3 class="subsection-title">Methods</h3>
142
143
144
145
146
147
148
149 <h4 class="name" id=".generateAndInstallKeyPair"><span class="type-signature">(static) </span>generateAndInstallKeyPair<span class="signature">(publicKeyDirctory, publicKeyOutFile, privateKeyFolder, privateKeyName, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
150
151
152
153
154
155
156<div class="description">
157 <p>Generates and installs a public/private key pair if not already installed</p>
158</div>
159
160
161
162
163
164
165
166
167
168 <h5>Parameters:</h5>
169
170
171<table class="params">
172 <thead>
173 <tr>
174
175 <th>Name</th>
176
177
178 <th>Type</th>
179
180
181 <th>Attributes</th>
182
183
184
185
186 <th class="last">Description</th>
187 </tr>
188 </thead>
189
190 <tbody>
191
192
193 <tr>
194
195 <td class="name"><code>publicKeyDirctory</code></td>
196
197
198 <td class="type">
199
200
201<span class="param-type">String</span>
202
203
204
205 </td>
206
207
208 <td class="attributes">
209
210
211
212
213
214 </td>
215
216
217
218
219 <td class="description last"><p>Directory into which to write the public key</p></td>
220 </tr>
221
222
223
224 <tr>
225
226 <td class="name"><code>publicKeyOutFile</code></td>
227
228
229 <td class="type">
230
231
232<span class="param-type">String</span>
233
234
235
236 </td>
237
238
239 <td class="attributes">
240
241
242
243
244
245 </td>
246
247
248
249
250 <td class="description last"><p>Filename for public key</p></td>
251 </tr>
252
253
254
255 <tr>
256
257 <td class="name"><code>privateKeyFolder</code></td>
258
259
260 <td class="type">
261
262
263<span class="param-type">String</span>
264
265
266
267 </td>
268
269
270 <td class="attributes">
271
272
273
274
275
276 </td>
277
278
279
280
281 <td class="description last"><p>BIG-IP folder into which to install the private key</p></td>
282 </tr>
283
284
285
286 <tr>
287
288 <td class="name"><code>privateKeyName</code></td>
289
290
291 <td class="type">
292
293
294<span class="param-type">String</span>
295
296
297
298 </td>
299
300
301 <td class="attributes">
302
303
304
305
306
307 </td>
308
309
310
311
312 <td class="description last"><p>Name for private key on BIG-IP</p></td>
313 </tr>
314
315
316
317 <tr>
318
319 <td class="name"><code>options</code></td>
320
321
322 <td class="type">
323
324
325<span class="param-type">Object</span>
326
327
328
329 </td>
330
331
332 <td class="attributes">
333
334 &lt;optional><br>
335
336
337
338
339
340 </td>
341
342
343
344
345 <td class="description last"><p>Optional parameters</p>
346 <h6>Properties</h6>
347
348
349<table class="params">
350 <thead>
351 <tr>
352
353 <th>Name</th>
354
355
356 <th>Type</th>
357
358
359 <th>Attributes</th>
360
361
362
363
364 <th class="last">Description</th>
365 </tr>
366 </thead>
367
368 <tbody>
369
370
371 <tr>
372
373 <td class="name"><code>force</code></td>
374
375
376 <td class="type">
377
378
379<span class="param-type">Boolean</span>
380
381
382
383 </td>
384
385
386 <td class="attributes">
387
388 &lt;optional><br>
389
390
391
392
393
394 </td>
395
396
397
398
399 <td class="description last"><p>Force generation even if private key exists</p></td>
400 </tr>
401
402
403
404 <tr>
405
406 <td class="name"><code>installPublic</code></td>
407
408
409 <td class="type">
410
411
412<span class="param-type">Boolean</span>
413
414
415
416 </td>
417
418
419 <td class="attributes">
420
421 &lt;optional><br>
422
423
424
425
426
427 </td>
428
429
430
431
432 <td class="description last"><p>Install the public key as an iFile (so that it is synced)</p></td>
433 </tr>
434
435
436 </tbody>
437</table>
438
439 </td>
440 </tr>
441
442
443 </tbody>
444</table>
445
446
447
448
449
450
451<dl class="details">
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484</dl>
485
486
487
488
489
490
491
492
493
494
495
496
497
498<h5>Returns:</h5>
499
500
501<div class="param-desc">
502 <p>A promise which is resolved with the name of the public key if we
503 installed one, or rejected if an error occurs.</p>
504</div>
505
506
507
508<dl>
509 <dt>
510 Type
511 </dt>
512 <dd>
513
514<span class="param-type">Promise</span>
515
516
517 </dd>
518</dl>
519
520
521
522
523
524
525
526
527
528
529
530
531
532 <h4 class="name" id=".getKeyFilePath"><span class="type-signature">(static) </span>getKeyFilePath<span class="signature">(folder, keyType, name)</span><span class="type-signature"></span></h4>
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547 <h5>Parameters:</h5>
548
549
550<table class="params">
551 <thead>
552 <tr>
553
554 <th>Name</th>
555
556
557 <th>Type</th>
558
559
560
561
562
563 <th class="last">Description</th>
564 </tr>
565 </thead>
566
567 <tbody>
568
569
570 <tr>
571
572 <td class="name"><code>folder</code></td>
573
574
575 <td class="type">
576
577
578<span class="param-type">String</span>
579
580
581
582 </td>
583
584
585
586
587
588 <td class="description last"><p>BIG-IP folder name.</p></td>
589 </tr>
590
591
592
593 <tr>
594
595 <td class="name"><code>keyType</code></td>
596
597
598 <td class="type">
599
600
601<span class="param-type">String</span>
602
603
604
605 </td>
606
607
608
609
610
611 <td class="description last"><p>File type. For example: certificate_key or ifile.</p></td>
612 </tr>
613
614
615
616 <tr>
617
618 <td class="name"><code>name</code></td>
619
620
621 <td class="type">
622
623
624<span class="param-type">String</span>
625
626
627
628 </td>
629
630
631
632
633
634 <td class="description last"><p>Name of key.</p></td>
635 </tr>
636
637
638 </tbody>
639</table>
640
641
642
643
644
645
646<dl class="details">
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679</dl>
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704 <h4 class="name" id=".getPrivateKeyMetadata"><span class="type-signature">(static) </span>getPrivateKeyMetadata<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
705
706
707
708
709
710
711<div class="description">
712 <p>Gets the local private key</p>
713</div>
714
715
716
717
718
719
720
721
722
723
724
725
726
727<dl class="details">
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760</dl>
761
762
763
764
765
766
767
768
769
770
771
772
773
774<h5>Returns:</h5>
775
776
777<div class="param-desc">
778 <p>A promise which is resolved with the key metadata or
779 rejected if an error occurs</p>
780</div>
781
782
783
784<dl>
785 <dt>
786 Type
787 </dt>
788 <dd>
789
790<span class="param-type">Promise</span>
791
792
793 </dd>
794</dl>
795
796
797
798
799
800
801
802
803
804
805
806
807
808 <h4 class="name" id="~listPrivateKey"><span class="type-signature">(inner) </span>listPrivateKey<span class="signature">(keyType, folder, name, noRetry<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
809
810
811
812
813
814
815<div class="description">
816 <p>List a private key by folder and name.</p>
817<p>Will first search for a private key with a '.key' suffix, and then without a '.key' suffix</p>
818</div>
819
820
821
822
823
824
825
826
827
828 <h5>Parameters:</h5>
829
830
831<table class="params">
832 <thead>
833 <tr>
834
835 <th>Name</th>
836
837
838 <th>Type</th>
839
840
841 <th>Attributes</th>
842
843
844
845
846 <th class="last">Description</th>
847 </tr>
848 </thead>
849
850 <tbody>
851
852
853 <tr>
854
855 <td class="name"><code>keyType</code></td>
856
857
858 <td class="type">
859
860
861<span class="param-type">String</span>
862
863
864
865 </td>
866
867
868 <td class="attributes">
869
870
871
872
873
874 </td>
875
876
877
878
879 <td class="description last"><p>Key Type to list. Examples: 'file ssl-key', crypto key</p></td>
880 </tr>
881
882
883
884 <tr>
885
886 <td class="name"><code>folder</code></td>
887
888
889 <td class="type">
890
891
892<span class="param-type">String</span>
893
894
895
896 </td>
897
898
899 <td class="attributes">
900
901
902
903
904
905 </td>
906
907
908
909
910 <td class="description last"><p>Folder in which to search for the private key.</p></td>
911 </tr>
912
913
914
915 <tr>
916
917 <td class="name"><code>name</code></td>
918
919
920 <td class="type">
921
922
923<span class="param-type">String</span>
924
925
926
927 </td>
928
929
930 <td class="attributes">
931
932
933
934
935
936 </td>
937
938
939
940
941 <td class="description last"><p>Name of the private key to search for</p></td>
942 </tr>
943
944
945
946 <tr>
947
948 <td class="name"><code>noRetry</code></td>
949
950
951 <td class="type">
952
953
954<span class="param-type">Boolean</span>
955
956
957
958 </td>
959
960
961 <td class="attributes">
962
963 &lt;optional><br>
964
965
966
967
968
969 </td>
970
971
972
973
974 <td class="description last"><p>Whether or not to retry command with a different private key name.</p></td>
975 </tr>
976
977
978 </tbody>
979</table>
980
981
982
983
984
985
986<dl class="details">
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019</dl>
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033<h5>Returns:</h5>
1034
1035
1036<div class="param-desc">
1037 <p>A promise which will be resolved with a dictionary containing the name of the
1038 found private key, and the tmsh command response:</p>
1039<pre class="prettyprint source"><code> {
1040 privateKeyName: &lt;String>,
1041 response: &lt;String>
1042 }</code></pre>
1043</div>
1044
1045
1046
1047<dl>
1048 <dt>
1049 Type
1050 </dt>
1051 <dd>
1052
1053<span class="param-type">Promise</span>
1054
1055
1056 </dd>
1057</dl>
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071</article>
1072
1073</section>
1074
1075
1076
1077
1078</div>
1079
1080<nav>
1081 <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-authn.html">authn</a></li><li><a href="module-bigIqLicenseProviderFactory.html">bigIqLicenseProviderFactory</a></li><li><a href="module-cryptoUtil.html">cryptoUtil</a></li><li><a href="module-httpUtil.html">httpUtil</a></li><li><a href="module-ipc.html">ipc</a></li><li><a href="module-localCryptoUtil.html">localCryptoUtil</a></li><li><a href="module-localKeyUtil.html">localKeyUtil</a></li><li><a href="module-logger.html">logger</a></li><li><a href="module-metricsCollector.html">metricsCollector</a></li><li><a href="module-sharedConstants.html">sharedConstants</a></li><li><a href="module-signals.html">signals</a></li><li><a href="module-util.html">util</a></li></ul><h3>Classes</h3><ul><li><a href="BigIp.html">BigIp</a></li><li><a href="BigIpCluster.html">BigIpCluster</a></li><li><a href="BigIpGtm.html">BigIpGtm</a></li><li><a href="BigIpOnboard.html">BigIpOnboard</a></li><li><a href="BigIq.html">BigIq</a></li><li><a href="BigIq50LicenseProvider.html">BigIq50LicenseProvider</a></li><li><a href="BigIq52LicenseProvider.html">BigIq52LicenseProvider</a></li><li><a href="BigIq53LicenseProvider.html">BigIq53LicenseProvider</a></li><li><a href="BigIq54LicenseProvider.html">BigIq54LicenseProvider</a></li><li><a href="CloudProvider.html">CloudProvider</a></li><li><a href="DnsProvider.html">DnsProvider</a></li><li><a href="GenericNodeProvider.html">GenericNodeProvider</a></li><li><a href="GtmDnsProvider.html">GtmDnsProvider</a></li><li><a href="IControl.html">IControl</a></li></ul><h3>Mixins</h3><ul><li><a href="bigIqClusterMixins.html">bigIqClusterMixins</a></li><li><a href="bigIqOnboardMixins.html">bigIqOnboardMixins</a></li></ul><h3>Global</h3><ul><li><a href="global.html#checkTask">checkTask</a></li><li><a href="global.html#forceResetUserPassword">forceResetUserPassword</a></li><li><a href="global.html#getDataFromPropPath">getDataFromPropPath</a></li><li><a href="global.html#getLicenseProvider">getLicenseProvider</a></li></ul>
1082</nav>
1083
1084<br class="clear">
1085
1086<footer>
1087 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
1088</footer>
1089
1090<script> prettyPrint(); </script>
1091<script src="scripts/linenumber.js"> </script>
1092</body>
1093</html>
\No newline at end of file