Skip to content

Commit 4f60c85

Browse files
committed
✨ Implement encryption with ASCII armor #28
1 parent 44a8f6f commit 4f60c85

File tree

1 file changed

+34
-31
lines changed

1 file changed

+34
-31
lines changed

sdk-docs/Xecrets.Sdk.Abstractions.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,33 @@ The email to associate the key pair with.
5757
[System.Threading.Tasks.Task<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')[XfEncryptedKeyPair](Xecrets.Sdk.Models.XfEncryptedKeyPair.md 'Xecrets.Sdk.Models.XfEncryptedKeyPair')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')
5858
The [XfEncryptedKeyPair](Xecrets.Sdk.Models.XfEncryptedKeyPair.md 'Xecrets.Sdk.Models.XfEncryptedKeyPair')
5959

60+
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptArmorAsync(Xecrets.Sdk.Models.XfCredentials,string)'></a>
61+
62+
## IXfApi.DecryptArmorAsync(XfCredentials, string) Method
63+
64+
Decrypt an arbitrary string from ASCII armor format.
65+
66+
```csharp
67+
System.Threading.Tasks.Task<(string text,string fileName)> DecryptArmorAsync(Xecrets.Sdk.Models.XfCredentials credentials, string armor);
68+
```
69+
#### Parameters
70+
71+
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptArmorAsync(Xecrets.Sdk.Models.XfCredentials,string).credentials'></a>
72+
73+
`credentials` [XfCredentials](Xecrets.Sdk.Models.XfCredentials.md 'Xecrets.Sdk.Models.XfCredentials')
74+
75+
One or more passwords to decrypt with.
76+
77+
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptArmorAsync(Xecrets.Sdk.Models.XfCredentials,string).armor'></a>
78+
79+
`armor` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
80+
81+
The ASCII armor string to decrypt.
82+
83+
#### Returns
84+
[System.Threading.Tasks.Task&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')[&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')
85+
The decrypted text, and the original file name embedded in the encrypted data.
86+
6087
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptFilesInPlaceAsync(Xecrets.Sdk.Models.XfCredentials,System.Collections.Generic.IEnumerable_Xecrets.Sdk.Models.XfFilePair_,System.Action_Xecrets.Sdk.Cli.CliMessage_)'></a>
6188

6289
## IXfApi.DecryptFilesInPlaceAsync(XfCredentials, IEnumerable<XfFilePair>, Action<CliMessage>) Method
@@ -134,7 +161,7 @@ System.Threading.Tasks.Task<string> DecryptStreamAsync(Xecrets.Sdk.Models.XfCred
134161

135162
`credentials` [XfCredentials](Xecrets.Sdk.Models.XfCredentials.md 'Xecrets.Sdk.Models.XfCredentials')
136163

137-
One or more passwords to Decrypt with.
164+
One or more passwords to decrypt with.
138165

139166
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptStreamAsync(Xecrets.Sdk.Models.XfCredentials,System.IO.Stream,System.IO.Stream).cipherStream'></a>
140167

@@ -153,33 +180,6 @@ A stream to write the clear text to.
153180
A [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') to wait for and the original file name as a string, or an empty string if the
154181
credentials were invalid.
155182

156-
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptTextAsync(Xecrets.Sdk.Models.XfCredentials,string)'></a>
157-
158-
## IXfApi.DecryptTextAsync(XfCredentials, string) Method
159-
160-
Decrypt an arbitrary string from ASCII armor format.
161-
162-
```csharp
163-
System.Threading.Tasks.Task<(string text,string fileName)> DecryptTextAsync(Xecrets.Sdk.Models.XfCredentials credentials, string text);
164-
```
165-
#### Parameters
166-
167-
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptTextAsync(Xecrets.Sdk.Models.XfCredentials,string).credentials'></a>
168-
169-
`credentials` [XfCredentials](Xecrets.Sdk.Models.XfCredentials.md 'Xecrets.Sdk.Models.XfCredentials')
170-
171-
One or more passwords to Decrypt with.
172-
173-
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptTextAsync(Xecrets.Sdk.Models.XfCredentials,string).text'></a>
174-
175-
`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
176-
177-
The ASCII armor string to decrypt.
178-
179-
#### Returns
180-
[System.Threading.Tasks.Task&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')[&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')
181-
The decrypted text, and the original file name embedded in the encrypted data.
182-
183183
<a name='Xecrets.Sdk.Abstractions.IXfApi.DecryptToAndKeepFileAsync(Xecrets.Sdk.Models.XfCredentials,System.IO.FileInfo,System.IO.DirectoryInfo,System.Action_Xecrets.Sdk.Cli.CliMessage_)'></a>
184184

185185
## IXfApi.DecryptToAndKeepFileAsync(XfCredentials, FileInfo, DirectoryInfo, Action<CliMessage>) Method
@@ -242,7 +242,8 @@ The credentials to use when encrypting the files.
242242

243243
`overwrite` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')
244244

245-
Set to 'false' if overwriting the target should be disallowed, and instead use an alternate non-colliding name.
245+
Set to 'false' if overwriting the target should be disallowed, and instead use an
246+
alternate non-colliding name.
246247

247248
<a name='Xecrets.Sdk.Abstractions.IXfApi.EncryptFilesAsync(Xecrets.Sdk.Models.XfCredentials,bool,bool,System.Collections.Generic.IEnumerable_Xecrets.Sdk.Models.XfFilePair_,System.Action_Xecrets.Sdk.Cli.CliMessage_).wipe'></a>
248249

@@ -254,13 +255,15 @@ Set to 'true' to also wipe the original plain text.
254255

255256
`pairs` [System.Collections.Generic.IEnumerable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[XfFilePair](Xecrets.Sdk.Models.XfFilePair.md 'Xecrets.Sdk.Models.XfFilePair')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')
256257

257-
File name pairs, providing source and target names as well as original name to include in the encrypted file.
258+
File name pairs, providing source and target names as well as original name to include
259+
in the encrypted file.
258260

259261
<a name='Xecrets.Sdk.Abstractions.IXfApi.EncryptFilesAsync(Xecrets.Sdk.Models.XfCredentials,bool,bool,System.Collections.Generic.IEnumerable_Xecrets.Sdk.Models.XfFilePair_,System.Action_Xecrets.Sdk.Cli.CliMessage_).progress'></a>
260262

261263
`progress` [System.Action&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[CliMessage](Xecrets.Sdk.Cli.CliMessage.md 'Xecrets.Sdk.Cli.CliMessage')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')
262264

263-
An [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that will be called reporting progress of the operation.
265+
An [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that will be called reporting progress of the
266+
operation.
264267

265268
#### Returns
266269
[System.Threading.Tasks.Task&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')[System.Collections.Generic.IEnumerable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.IO.FileInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileInfo 'System.IO.FileInfo')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task`1')

0 commit comments

Comments
 (0)