summaryrefslogtreecommitdiffstats
path: root/base/native-tools/src/tkstool/file.c
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-11-30 00:23:23 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-11-30 00:23:23 -0500
commita35f90bf9ed2c7147188597f2e75f30cedde1076 (patch)
treed0d47343e2cd03a31bfcc3e5ec98ccb1a7ca2fdd /base/native-tools/src/tkstool/file.c
parent2580faf9ed74f466ff327f6d961c8e7d8b55ed0f (diff)
downloadpki-a35f90bf9ed2c7147188597f2e75f30cedde1076.tar.gz
pki-a35f90bf9ed2c7147188597f2e75f30cedde1076.tar.xz
pki-a35f90bf9ed2c7147188597f2e75f30cedde1076.zip
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;
+}