-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate 64 character hexadecimal labels
- Loading branch information
Duncan Jones
committed
Mar 7, 2019
1 parent
529d2c9
commit 3f49460
Showing
3 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package crypto11 | ||
|
||
import ( | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func TestGenerateKeyLabel(t *testing.T) { | ||
_, err := ConfigureFromFile("config") | ||
require.NoError(t, err) | ||
|
||
for i :=0; i < 100; i++ { | ||
label, err := generateKeyLabel() | ||
require.NoError(t, err) | ||
require.Len(t, label, labelLength) | ||
for _, b := range label { | ||
require.NotEqual(t, byte(0), b) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"Path" : "/opt/nfast/toolkits/pkcs11/libcknfast.so", | ||
"TokenLabel": "rjk", | ||
"Path" : "/usr/lib/softhsm/libsofthsm2.so", | ||
"TokenLabel": "token1", | ||
"Pin" : "password" | ||
} |