summaryrefslogtreecommitdiff
path: root/man/2
diff options
context:
space:
mode:
authorforsyth <forsyth@vitanuova.com>2011-04-03 15:03:05 +0100
committerforsyth <forsyth@vitanuova.com>2011-04-03 15:03:05 +0100
commit728860af799ffd5aa8b3b90576ae582b11b7f5a5 (patch)
treeb6e969a01af2a3d56d7296b96002476dd116fa8d /man/2
parent41858f31398f2a5187173202c165df7717217c89 (diff)
20110403-1502
Diffstat (limited to 'man/2')
-rw-r--r--man/2/secstore31
1 files changed, 29 insertions, 2 deletions
diff --git a/man/2/secstore b/man/2/secstore
index d6395955..6bb11674 100644
--- a/man/2/secstore
+++ b/man/2/secstore
@@ -23,13 +23,13 @@ files: fn(conn: ref Dial->Connection):
list of (string, int, string, string, array of byte);
getfile: fn(conn: ref Dial->Connection, name: string,
maxsize: int): array of byte;
-.\"putfile: fn(conn: ref Dial->Connection, name: string, data: array of byte,): int;
+putfile: fn(conn: ref Dial->Connection, name: string, data: array of byte): int;
remove: fn(conn: ref Dial->Connection, file: string): int;
bye: fn(conn: ref Dial->Connection);
mkfilekey: fn(pass: string): array of byte;
decrypt: fn(data: array of byte, filekey: array of byte): array of byte;
-.\"encrypt: fn(data: array of byte, filekey: array of byte): array of byte;
+encrypt: fn(data: array of byte, filekey: array of byte): array of byte;
erasekey: fn(key: array of byte);
lines: fn(file: array of byte): list of array of byte;
@@ -193,6 +193,19 @@ is not the same value as the
.I seckey
used for initial authentication, although the secret text is the same.)
.PP
+.B Putfile
+writes
+.I data
+under file
+.I name
+to the secure store, overwriting a possibly existing file by that name.
+.I Data
+should already be encrypted.
+The caller can arrange this by calling
+.BR encrypt .
+.B Putfile
+returns 0 on success and a negative value on error.
+.PP
.B Remove
deletes the given
.I file
@@ -216,6 +229,19 @@ It returns nil if the file could not be decrypted (usually because the
.I key
value is not actually the encryption key).
.PP
+.B Encrypt
+does the opposite of
+.BR decrypt .
+Given plain
+.I data
+and
+.I filekey
+produced by
+.BR mkfilekey ,
+it returns an encrypted version of data, including headers and trailers.
+This data is suitable for writing to the secure store with
+.BR putfile .
+.PP
.B Erasekey
clears the bytes of
.I key
@@ -247,5 +273,6 @@ closes the connection to the
As well as returning the error values described above, functions set the system error string.
.SH SEE ALSO
.IR crypt (1),
+.IR secstore (1),
.IR factotum (2),
.IR factotum (4)