From a35f90bf9ed2c7147188597f2e75f30cedde1076 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Fri, 30 Nov 2012 00:23:23 -0500 Subject: WIP --- base/native-tools/src/tkstool/file.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'base/native-tools/src/tkstool/file.c') 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, "\n", 24 ); + if( r < 0 ) { + status = SECFailure; + goto close; + } + +close: + PR_Close( fd ); + +done: + return status; +} -- cgit