Skip to content

Commit 98107ee

Browse files
committed
✨ Add --load-private-keys option #95
1 parent f1647a3 commit 98107ee

29 files changed

+738
-131
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.403",
3+
"version": "8.0.404",
44
"rollForward": "disable",
55
"allowPrerelease": false
66
}

sdk-docs/Xecrets.Sdk.Abstractions.md

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,33 @@ string[] StartMe(string fileNameWithoutExtension);
408408

409409
[System.InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/System.InvalidOperationException 'System.InvalidOperationException')
410410

411+
<a name='Xecrets.Sdk.Abstractions.IXfApi.UpdatePrivateKeysAsync(Xecrets.Sdk.Models.XfCredentials,string)'></a>
412+
413+
## IXfApi.UpdatePrivateKeysAsync(XfCredentials, string) Method
414+
415+
Load private keys for decryption, returning an updated version with the same keys.
416+
417+
```csharp
418+
System.Threading.Tasks.Task<string> UpdatePrivateKeysAsync(Xecrets.Sdk.Models.XfCredentials credentials, string json);
419+
```
420+
#### Parameters
421+
422+
<a name='Xecrets.Sdk.Abstractions.IXfApi.UpdatePrivateKeysAsync(Xecrets.Sdk.Models.XfCredentials,string).credentials'></a>
423+
424+
`credentials` [XfCredentials](Xecrets.Sdk.Models.XfCredentials.md 'Xecrets.Sdk.Models.XfCredentials')
425+
426+
One or more passwords to decrypt the private keys with.
427+
428+
<a name='Xecrets.Sdk.Abstractions.IXfApi.UpdatePrivateKeysAsync(Xecrets.Sdk.Models.XfCredentials,string).json'></a>
429+
430+
`json` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
431+
432+
A json serialized instance with private keys.
433+
434+
#### Returns
435+
[System.Threading.Tasks.Task&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')
436+
The updated encrypted keys json.
437+
411438
<a name='Xecrets.Sdk.Abstractions.IXfApi.WipeFilesAsync(System.Collections.Generic.IEnumerable_string_,System.Action_Xecrets.Sdk.Cli.CliMessage_)'></a>
412439

413440
## IXfApi.WipeFilesAsync(IEnumerable<string>, Action<CliMessage>) Method
@@ -449,31 +476,24 @@ Derived
449476
&#8627; [XfApiFactory](Xecrets.Sdk.XfApiFactory.md 'Xecrets.Sdk.XfApiFactory')
450477
### Methods
451478

452-
<a name='Xecrets.Sdk.Abstractions.IXfApiFactory.Create()'></a>
479+
<a name='Xecrets.Sdk.Abstractions.IXfApiFactory.Create(System.Nullable_bool_,System.Threading.CancellationToken)'></a>
453480

454-
## IXfApiFactory.Create() Method
481+
## IXfApiFactory.Create(Nullable<bool>, CancellationToken) Method
455482

456-
Create an [IXfApi](Xecrets.Sdk.Abstractions.md#Xecrets.Sdk.Abstractions.IXfApi 'Xecrets.Sdk.Abstractions.IXfApi') instance without cancellation."/>
483+
Create an [IXfApi](Xecrets.Sdk.Abstractions.md#Xecrets.Sdk.Abstractions.IXfApi 'Xecrets.Sdk.Abstractions.IXfApi') instance.
457484

458485
```csharp
459-
Xecrets.Sdk.Abstractions.IXfApi Create();
486+
Xecrets.Sdk.Abstractions.IXfApi Create(System.Nullable<bool> debugOverride, System.Threading.CancellationToken ct);
460487
```
488+
#### Parameters
461489

462-
#### Returns
463-
[IXfApi](Xecrets.Sdk.Abstractions.md#Xecrets.Sdk.Abstractions.IXfApi 'Xecrets.Sdk.Abstractions.IXfApi')
464-
465-
<a name='Xecrets.Sdk.Abstractions.IXfApiFactory.Create(System.Threading.CancellationToken)'></a>
466-
467-
## IXfApiFactory.Create(CancellationToken) Method
490+
<a name='Xecrets.Sdk.Abstractions.IXfApiFactory.Create(System.Nullable_bool_,System.Threading.CancellationToken).debugOverride'></a>
468491

469-
Create an [IXfApi](Xecrets.Sdk.Abstractions.md#Xecrets.Sdk.Abstractions.IXfApi 'Xecrets.Sdk.Abstractions.IXfApi') instance.
492+
`debugOverride` [System.Nullable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')
470493

471-
```csharp
472-
Xecrets.Sdk.Abstractions.IXfApi Create(System.Threading.CancellationToken ct);
473-
```
474-
#### Parameters
494+
Override the global debug cli flag if non-null.
475495

476-
<a name='Xecrets.Sdk.Abstractions.IXfApiFactory.Create(System.Threading.CancellationToken).ct'></a>
496+
<a name='Xecrets.Sdk.Abstractions.IXfApiFactory.Create(System.Nullable_bool_,System.Threading.CancellationToken).ct'></a>
477497

478498
`ct` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken')
479499

sdk-docs/Xecrets.Sdk.Cli.CliMessage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public string? Message { get; set; }
9494

9595
## CliMessage.OpCode Property
9696

97-
The current [Xecrets.Cli.Public.XfOpCode](https://docs.microsoft.com/en-us/dotnet/api/Xecrets.Cli.Public.XfOpCode 'Xecrets.Cli.Public.XfOpCode') for this response.
97+
The current [Xecrets.Sdk.Cli.XfOpCode](https://docs.microsoft.com/en-us/dotnet/api/Xecrets.Sdk.Cli.XfOpCode 'Xecrets.Sdk.Cli.XfOpCode') for this response.
9898
9999
```csharp
100100
public int OpCode { get; set; }
@@ -107,7 +107,7 @@ public int OpCode { get; set; }
107107

108108
## CliMessage.OpCodeName Property
109109

110-
The name of the [Xecrets.Cli.Public.XfOpCode](https://docs.microsoft.com/en-us/dotnet/api/Xecrets.Cli.Public.XfOpCode 'Xecrets.Cli.Public.XfOpCode') for this response.
110+
The name of the [Xecrets.Sdk.Cli.XfOpCode](https://docs.microsoft.com/en-us/dotnet/api/Xecrets.Sdk.Cli.XfOpCode 'Xecrets.Sdk.Cli.XfOpCode') for this response.
111111
112112
```csharp
113113
public string? OpCodeName { get; set; }

sdk-docs/Xecrets.Sdk.Cli.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Xecrets.Sdk.Cli Namespace
44

5+
The three classes [Xecrets.Sdk.Cli.XfOpCode](https://docs.microsoft.com/en-us/dotnet/api/Xecrets.Sdk.Cli.XfOpCode 'Xecrets.Sdk.Cli.XfOpCode'), [Xecrets.Sdk.Cli.XfStatusCode](https://docs.microsoft.com/en-us/dotnet/api/Xecrets.Sdk.Cli.XfStatusCode 'Xecrets.Sdk.Cli.XfStatusCode') and [Xecrets.Sdk.Cli.XfCliApi](https://docs.microsoft.com/en-us/dotnet/api/Xecrets.Sdk.Cli.XfCliApi 'Xecrets.Sdk.Cli.XfCliApi') are imported
6+
from XecretsCli using the --cli-options-code-export argument and copy/pasted here to be available for use
7+
without needing an actual reference to the XecretsCli-assembly. If XfCliVersion is updated, then the
8+
corresponding code changes must be made to maintain compatibility and [XfSdkVersion](Xecrets.Sdk.XfSdkVersion.md 'Xecrets.Sdk.XfSdkVersion')
9+
must be updated to reflect the updated compatibility.
10+
511
| Classes | |
612
| :--- | :--- |
713
| [CliMessage](Xecrets.Sdk.Cli.CliMessage.md 'Xecrets.Sdk.Cli.CliMessage') | Log output and progress from the command line tool. |

sdk-docs/Xecrets.Sdk.Models.XfCredentials.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ public System.Collections.Generic.IEnumerable<string> Passwords { get; }
3939
#### Property Value
4040
[System.Collections.Generic.IEnumerable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')
4141
42+
<a name='Xecrets.Sdk.Models.XfCredentials.PrivateKeyFullNames'></a>
43+
44+
## XfCredentials.PrivateKeyFullNames Property
45+
46+
An enumeration of full path names to encrypted private key files in the XfEncryptedKeys format
47+
48+
```csharp
49+
public System.Collections.Generic.IEnumerable<string> PrivateKeyFullNames { get; }
50+
```
51+
52+
#### Property Value
53+
[System.Collections.Generic.IEnumerable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')
54+
4255
<a name='Xecrets.Sdk.Models.XfCredentials.PublicKeyEmails'></a>
4356

4457
## XfCredentials.PublicKeyEmails Property
@@ -117,6 +130,24 @@ public void AddPasswords(System.Collections.Generic.IEnumerable<string> password
117130
118131
An enumeration of passwords to add.
119132

133+
<a name='Xecrets.Sdk.Models.XfCredentials.AddPrivateKeysFullNames(System.Collections.Generic.IEnumerable_string_)'></a>
134+
135+
## XfCredentials.AddPrivateKeysFullNames(IEnumerable<string>) Method
136+
137+
Add zero or more full path names to encrypted private keys to add to the collection of credentials.
138+
139+
```csharp
140+
public void AddPrivateKeysFullNames(System.Collections.Generic.IEnumerable<string> encryptedPrivateKeyFullNames);
141+
```
142+
#### Parameters
143+
144+
<a name='Xecrets.Sdk.Models.XfCredentials.AddPrivateKeysFullNames(System.Collections.Generic.IEnumerable_string_).encryptedPrivateKeyFullNames'></a>
145+
146+
`encryptedPrivateKeyFullNames` [System.Collections.Generic.IEnumerable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')
147+
148+
An enumeration of full path names to files containing encrypted
149+
private keys.
150+
120151
<a name='Xecrets.Sdk.Models.XfCredentials.AddPublicKeyEmails(System.Collections.Generic.IEnumerable_string_)'></a>
121152

122153
## XfCredentials.AddPublicKeyEmails(IEnumerable<string>) Method
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#### [Xecrets.Sdk](index.md 'index')
2+
### [Xecrets.Sdk.Models](Xecrets.Sdk.Models.md 'Xecrets.Sdk.Models').[XfEncryptedKeys](Xecrets.Sdk.Models.XfEncryptedKeys.md 'Xecrets.Sdk.Models.XfEncryptedKeys')
3+
4+
## XfEncryptedKeys.EncryptedKey Class
5+
6+
An encrypted private key with additional metadata.
7+
8+
```csharp
9+
public class XfEncryptedKeys.EncryptedKey :
10+
System.IEquatable<Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey>
11+
```
12+
13+
Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') &#129106; EncryptedKey
14+
15+
Implements [System.IEquatable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[EncryptedKey](Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey.md 'Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')
16+
### Properties
17+
18+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey.Email'></a>
19+
20+
## XfEncryptedKeys.EncryptedKey.Email Property
21+
22+
The email address of the user this key belongs to.
23+
24+
```csharp
25+
public string Email { get; set; }
26+
```
27+
28+
#### Property Value
29+
[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
30+
31+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey.EncryptedKeyPair'></a>
32+
33+
## XfEncryptedKeys.EncryptedKey.EncryptedKeyPair Property
34+
35+
The key pair, with the private key encrypted.
36+
37+
```csharp
38+
public Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair EncryptedKeyPair { get; set; }
39+
```
40+
41+
#### Property Value
42+
[EncryptedKeyPair](Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair.md 'Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair')
43+
44+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey.PrivateKeyStatus'></a>
45+
46+
## XfEncryptedKeys.EncryptedKey.PrivateKeyStatus Property
47+
48+
Wether the private key password was known or unknown when last serialized.
49+
50+
```csharp
51+
public Xecrets.Sdk.Models.XfEncryptedKeys.PrivateKeyPassword PrivateKeyStatus { get; set; }
52+
```
53+
54+
#### Property Value
55+
[PrivateKeyPassword](Xecrets.Sdk.Models.XfEncryptedKeys.md#Xecrets.Sdk.Models.XfEncryptedKeys.PrivateKeyPassword 'Xecrets.Sdk.Models.XfEncryptedKeys.PrivateKeyPassword')
56+
57+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey.Thumbprint'></a>
58+
59+
## XfEncryptedKeys.EncryptedKey.Thumbprint Property
60+
61+
The thumbprint of the key, used to identify it if required.
62+
63+
```csharp
64+
public string Thumbprint { get; set; }
65+
```
66+
67+
#### Property Value
68+
[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
69+
70+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey.Timestamp'></a>
71+
72+
## XfEncryptedKeys.EncryptedKey.Timestamp Property
73+
74+
The timestamp when the key was created.
75+
76+
```csharp
77+
public System.DateTime Timestamp { get; set; }
78+
```
79+
80+
#### Property Value
81+
[System.DateTime](https://docs.microsoft.com/en-us/dotnet/api/System.DateTime 'System.DateTime')
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#### [Xecrets.Sdk](index.md 'index')
2+
### [Xecrets.Sdk.Models](Xecrets.Sdk.Models.md 'Xecrets.Sdk.Models').[XfEncryptedKeys](Xecrets.Sdk.Models.XfEncryptedKeys.md 'Xecrets.Sdk.Models.XfEncryptedKeys')
3+
4+
## XfEncryptedKeys.EncryptedKeyPair Class
5+
6+
A key pair with a public and an encrypted private key pem. Then encryption is done with a password
7+
using Xecrets Ez/AxCrypt and then the encrypted file is base64 encoded.
8+
9+
```csharp
10+
public class XfEncryptedKeys.EncryptedKeyPair :
11+
System.IEquatable<Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair>
12+
```
13+
14+
Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') &#129106; EncryptedKeyPair
15+
16+
Implements [System.IEquatable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[EncryptedKeyPair](Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair.md 'Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')
17+
### Properties
18+
19+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair.EncryptedPrivateKey'></a>
20+
21+
## XfEncryptedKeys.EncryptedKeyPair.EncryptedPrivateKey Property
22+
23+
The encrypted private key pem.
24+
25+
```csharp
26+
public string EncryptedPrivateKey { get; set; }
27+
```
28+
29+
#### Property Value
30+
[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
31+
32+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKeyPair.PublicKey'></a>
33+
34+
## XfEncryptedKeys.EncryptedKeyPair.PublicKey Property
35+
36+
The public key pem.
37+
38+
```csharp
39+
public string PublicKey { get; set; }
40+
```
41+
42+
#### Property Value
43+
[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#### [Xecrets.Sdk](index.md 'index')
2+
### [Xecrets.Sdk.Models](Xecrets.Sdk.Models.md 'Xecrets.Sdk.Models').[XfEncryptedKeys](Xecrets.Sdk.Models.XfEncryptedKeys.md 'Xecrets.Sdk.Models.XfEncryptedKeys')
3+
4+
## XfEncryptedKeys.EncryptedUserKeys Class
5+
6+
A collection of encrypted private keys for a user, where a user is arbitrarily defined as an email address.
7+
8+
```csharp
9+
public class XfEncryptedKeys.EncryptedUserKeys :
10+
System.IEquatable<Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedUserKeys>
11+
```
12+
13+
Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') &#129106; EncryptedUserKeys
14+
15+
Implements [System.IEquatable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[EncryptedUserKeys](Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedUserKeys.md 'Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedUserKeys')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')
16+
17+
### Remarks
18+
Normally all the keys belong to the same physical user, but due to email changes etc the keys may be
19+
associated with different email addresses.
20+
### Properties
21+
22+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedUserKeys.Email'></a>
23+
24+
## XfEncryptedKeys.EncryptedUserKeys.Email Property
25+
26+
The email address identifier for this list of keys.
27+
28+
```csharp
29+
public string Email { get; set; }
30+
```
31+
32+
#### Property Value
33+
[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
34+
35+
<a name='Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedUserKeys.EncryptedKeys'></a>
36+
37+
## XfEncryptedKeys.EncryptedUserKeys.EncryptedKeys Property
38+
39+
A list of encrypted keys for this email.
40+
41+
```csharp
42+
public System.Collections.Generic.IList<Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey> EncryptedKeys { get; set; }
43+
```
44+
45+
#### Property Value
46+
[System.Collections.Generic.IList&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[EncryptedKey](Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey.md 'Xecrets.Sdk.Models.XfEncryptedKeys.EncryptedKey')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')

0 commit comments

Comments
 (0)