25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
-
+
+
+
-
+
|
#
# NOTE: Indicate to the caller, if any, that we have failed.
#
exit 1
}
proc maybeForceHashAlgorithm { certificate keyPairType } {
proc maybeForceHashAlgorithm { certificate keyPair } {
#
# HACK: Some key pair types, e.g. DSA v1, require hard-coded
# hash algorithms, e.g. SHA1. Do that now, if needed.
#
if {[isNonNullObjectHandle $keyPair] && \
[lsearch -exact -- [keypair metadata] KeyPairType] != -1 && \
if {$keyPairType eq "DSA"} then {
[$keyPair KeyPairType] eq "DSA"} then {
$certificate HashAlgorithm SHA1
}
}
proc isScriptFile { fileName } {
switch -exact -- [file extension $fileName] {
.tcl -
|
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
|
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
|
-
+
|
#
set certificateFile $fileName
#
# NOTE: Import the license certificate.
#
set certificate [certificate import $fileName]
maybeForceHashAlgorithm $certificate [$privateKey KeyPairType]
maybeForceHashAlgorithm $certificate $privateKey
#
# HOOK: Post-certificate object creation (import).
#
catch {certificate_hook phase1}
#
|
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
|
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
|
-
+
|
if {$importFirst} then {
set certificate [certificate import -alias $certificateFile]
} else {
set certificate [object create -alias \
Licensing.Components.Public.Certificate]
}
maybeForceHashAlgorithm $certificate [$privateKey KeyPairType]
maybeForceHashAlgorithm $certificate $privateKey
#
# HOOK: Post-certificate object creation (create).
#
catch {certificate_hook phase1}
#
|