03-18-2011
help with private keys (blocs) extraction from file
Hello,
I need to extract blocs (private keys) from a file so that each bloc gets extracted to a separate file (*.priv), on the fly
I started to fiddle with awk, without much luck so far....
A block always has this pattern:
----- BEGIN CERTIFICATE -----
variable number of lines (never fixed, not known in advance)
----- END CERTIFICATE -----
The file could look like this :
----- BEGIN CERTIFICATE -----
zrzrfd
gdfgsgfhfgh
fghfg
fhfhhhhhhhhhhh
----- END CERTIFICATE -----
----- BEGIN CERTIFICATE -----
zerzrz
zerzrrruy
----- END CERTIFICATE -----
----- BEGIN CERTIFICATE -----
etuiyuvvvezrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrzfz
zrrrrrrrrr
zr
----- END CERTIFICATE -----
----- BEGIN CERTIFICATE -----
zerrrrrrrrrrrrrrrrrrrrrrrr
----- END CERTIFICATE -----
Thanks a ton in advance for any hints...
pat38000
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how to use the arrow keys in shell scripting. is there any special synatax / command for this.
i just want to use the arrow keys for navigation.
replies appreciated
raguram R (3 Replies)
Discussion started by: raguramtgr
3 Replies
2. UNIX for Advanced & Expert Users
Firstly, i apologise if i have posted in a wrong section of the forum. Please let me know which is the correct section my post should go to.
I have to SCP a file from one server(server A) to another (server B). I read around that a secure way is to use public and private keys.
Assuming my... (2 Replies)
Discussion started by: new2ss
2 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I have an issue with an outside party trying to deliver a file to our server via SFTP.
I have setup the .ssh directory under the home directory for the user account that is being used and setup the authorized_keys file with correct permissons etc for .ssh directory and file.
We... (2 Replies)
Discussion started by: richo king
2 Replies
4. HP-UX
HI,
I'm trying to create SSH public/private keys using following command.
hp023:/users/vikram> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/users/vikram/.ssh/id_rsa): rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase... (9 Replies)
Discussion started by: vickramshetty
9 Replies
5. Solaris
Where in the world are the ssh private keys stored on the home server? I know the public keys are renamed to authorized_keys under the /export/home//.ssh directory on the remote server. (1 Reply)
Discussion started by: jastanle84
1 Replies
6. UNIX for Advanced & Expert Users
Hello,
I just installed a bran new Centos 6.2 including openssh 5.3.
On older servers I installed older Linux including openssh 4.3,
I am using keygen with private/public keys to log root on all servers (in a LAN) without typing password each time.
To do this, of course, I have my local... (4 Replies)
Discussion started by: epoins
4 Replies
7. Shell Programming and Scripting
Hi all,
I needed a shell script for file transfering using public/private keys for authentication.
Could you please help me out on this?
A procedure to write a shell script is enough.
Thanks in advance.
Regards.
Vidya N (8 Replies)
Discussion started by: Vidya N
8 Replies
8. Shell Programming and Scripting
Hi All,
I have a query....say on server A, I have generated the Private and Public keys and shared the public key with server B.
Now i can surelyconnect(without password) from server A to server B.....
but can i similarly connect from server B to server A as well
Regards (1 Reply)
Discussion started by: Arpit Narula
1 Replies
9. Shell Programming and Scripting
hi guys , i have few files i have to do sftp, the public and private key work like a magic , no problem at all
the syntax is as below
sftp -0 identityfile=~/ure/blsl/loc2/.ssh/id_rsa_ssh1 ssh1@remote >log_dir/file.timestamp<<end
lcd folder
cd folder
put *
quit
end
================
my... (3 Replies)
Discussion started by: rockymayavia
3 Replies
10. Shell Programming and Scripting
FILE_ID extraction from file name and save it in CSV file after looping through each folders
My files are located in UNIX Server, i want to extract file_id and file_name from each file .and save it in a CSV file. How do I do that?
I have folders in unix environment, directory structure is... (15 Replies)
Discussion started by: princetd001
15 Replies
LEARN ABOUT SUSE
gnutls_certificate_set_x509_key_mem
gnutls_certificate_set_x509_key_mem(3) gnutls gnutls_certificate_set_x509_key_mem(3)
NAME
gnutls_certificate_set_x509_key_mem - Used to set keys in a gnutls_certificate_credentials_t structure
SYNOPSIS
#include <gnutls/gnutls.h>
int gnutls_certificate_set_x509_key_mem(gnutls_certificate_credentials_t res, const gnutls_datum_t * cert, const gnutls_datum_t * key,
gnutls_x509_crt_fmt_t type);
ARGUMENTS
gnutls_certificate_credentials_t res
is a gnutls_certificate_credentials_t structure.
const gnutls_datum_t * cert
contains a certificate list (path) for the specified private key
const gnutls_datum_t * key
is the private key, or NULL
gnutls_x509_crt_fmt_t type
is PEM or DER
DESCRIPTION
This function sets a certificate/private key pair in the gnutls_certificate_credentials_t structure. This function may be called more than
once (in case multiple keys/certificates exist for the server).
CURRENTLY ARE SUPPORTED
RSA PKCS-1 encoded private keys, DSA private keys.
DSA private keys are encoded the OpenSSL way, which is an ASN.1 DER sequence of 6 INTEGERs - version, p, q, g, pub, priv.
Note that the keyUsage (2.5.29.15) PKIX extension in X.509 certificates is supported. This means that certificates intended for signing
cannot be used for ciphersuites that require encryption.
If the certificate and the private key are given in PEM encoding then the strings that hold their values must be null terminated.
The key may be NULL if you are using a sign callback, see gnutls_sign_callback_set().
RETURNS
GNUTLS_E_SUCCESS on success, or an error code.
REPORTING BUGS
Report bugs to <bug-gnutls@gnu.org>. GnuTLS home page: http://www.gnu.org/software/gnutls/ General help using GNU software:
http://www.gnu.org/gethelp/
COPYRIGHT
Copyright (C) 2008 Free Software Foundation.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
SEE ALSO
The full documentation for gnutls is maintained as a Texinfo manual. If the info and gnutls programs are properly installed at your site,
the command
info gnutls
should give you access to the complete manual.
gnutls 2.8.6 gnutls_certificate_set_x509_key_mem(3)