summaryrefslogtreecommitdiffstats
path: root/base/native-tools/src/tkstool/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'base/native-tools/src/tkstool/file.c')
-rw-r--r--base/native-tools/src/tkstool/file.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/base/native-tools/src/tkstool/file.c b/base/native-tools/src/tkstool/file.c
index d757225fc..6e95f03fa 100644
--- a/base/native-tools/src/tkstool/file.c
+++ b/base/native-tools/src/tkstool/file.c
@@ -516,3 +516,28 @@ destroyHexWrappedKey:
return status;
}
+SECStatus
+TKS_WriteSharedKeyIntoOutputFile( char *output )
+{
+ SECStatus status = SECSuccess;
+ PRFileDesc *fd = NULL;
+ PRInt32 r = 0;
+
+ fd = PR_Open( output, ( PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE ), 0600 );
+ if( !fd ) {
+ status = SECFailure;
+ goto done;
+ }
+
+ r = PR_Write( fd, "<SharedKey></SharedKey>\n", 24 );
+ if( r < 0 ) {
+ status = SECFailure;
+ goto close;
+ }
+
+close:
+ PR_Close( fd );
+
+done:
+ return status;
+}