summaryrefslogtreecommitdiffstats
path: root/doc/tests/rnpkeys-generate-key.md
blob: 113a9e697f6f9f2e8ea29457248f2d3e7f188b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# rnpkeys_generatekey_verifySupportedHashAlg

Component
: rnpkeys

Feature
: Generate-key

## Objective

Verify SupportedHashAlg.

## Description

The test aims to test key generation with all possible hash algorithm.
Following hash algorithm are tested for the key generation:

* `MD5`
* `SHA-1`
* `RIPEMD160`
* `SHA256`
* `SHA384`
* `SHA512`
* `SHA224`

## Preconditions

* Initialize RNP
* Set the default value for `res`, `format`, `hash` via `rnp_setvar()`.

## Test steps and expected behavior

1. Set the hash algorithm via `rnp_setvar`

1. Call the API to generate key (`rnp_generate_key`)

Expectation: key is generated using options set via `rnp_setvar`

## Verification steps and logic

1. Load the newly generated RNP keys
  * Rationale: Ensures keys are loaded in the `rnp` control structure
  for verification.

1. Find existence of key via `userId`.

  * **Note**: If `userid` variable is not set, default is `always`.
  * Rationale: Ensures the key exists by finding it.

## Comments

It is required to delete the old keys if the test case iterates over the
hashing algorithm.


# rnpkeys_generatekey_VerifyUserIdOption

Component
: rnpkeys

Feature
: Generate-key

## Objective

Verify `UserIdOption`

## Description

The test aims to test key generation with command line option `UserId`.

Following different `userid`s are tested:

* `rnpkeys_Generatekey_VerifyUserIdOption_MD5`
* `rnpkeys_Generatekey_VerifyUserIdOption_SHA-1`
* `rnpkeys_Generatekey_VerifyUserIdOption_RIPEMD160`
* `rnpkeys_Generatekey_VerifyUserIdOption_SHA256`
* `rnpkeys_Generatekey_VerifyUserIdOption_SHA384`
* `rnpkeys_Generatekey_VerifyUserIdOption_SHA512`
* `rnpkeys_Generatekey_VerifyUserIdOption_SHA224`


## Preconditions

* Initialize RNP
* Set the default value for res, format, hash via `rnp_setvar`.

## Test steps and expected behavior

1. Set the userId via `rnp_setvar`

1. Call the API to generate key (`rnp_generate_key`)

Expectation: key is generated using options set via `rnp_setvar`

## Verification steps and logic

1. Load the newly generated RNP keys
  * Rationale: Ensures keys are loaded in the rnp control structure for
  verification.

1. Find the existence of the key via finding the key with the userId.


# rnpkeys_generatekey_verifykeyRingOptions

Component
: rnpkeys

Feature
: Generate-key

## Objective

Verify keyRingOptions.

## Description

The test aims to test key generation with the user specified keyring.

## Preconditions

* Initialize RNP
* Set the default value for `res`, `format`, `hash` via `rnp_setvar()`.

## Test steps and expected behavior

1. Set the keyring via `rnp_setvar`

1. Call the API to generate key (`rnp_generate_key`)

Expectation: key is generated using options set via `rnp_setvar`

## Verification steps and logic

1. Delete the default keyring i.e. `pubring.gpg` and `secring.gpg` found
   in the homedir

  * Rationale: To ensure that default keyring is **NOT** available.

1. Load the newly generated RNP keys

  * Rationale: Ensures keys are loaded in the `rnp` control structure
  for verification.

1. Find existence of key via `userId`.

  * **Note**: If `userid` variable is not set, default is `always`.
  * Rationale: Ensures the key exists by finding it.


# rnpkeys_generatekey_verifykeyHomeDirOption

Component
: rnpkeys

Feature
: Generate-key

## Objective

Verify keyHomeDirOption.

## Description

The test aims to test key generation with the user specified keyring.

## Preconditions

* Create new home dir with read/write permissions.
* Delete the keys (if any) in the previous default directory.
* Initialize RNP
* Set the default value for `res`, `format`, `hash` via `rnp_setvar()`.

## Test steps and expected behavior

1. Call the API to generate key (`rnp_generate_key`)

Expectation: key is generated using options set via `rnp_setvar`

## Verification steps and logic

1. Load the newly generated RNP keys

  * Rationale: Ensures keys are loaded in the rnp control structure for
  verification.

1. Find existence of key via `userId`.

  * **Note**: If `userid` variable is not set, default is `always`.
  * Rationale: Ensures the key exists by finding it.