Sponsored Content
Top Forums Shell Programming and Scripting Delete duplicates in CA bundle Post 302907501 by Don Cragun on Saturday 28th of June 2014 06:25:02 PM
Old 06-28-2014
Quote:
Originally Posted by diva_thilak
I do have a big CA bundle certificate file and each time if i get request to add new certificate to the existing bundle i need to make sure it is not present already. How i can validate the duplicates.

The alignment of the certificate within the bundle seems to be different.

Example:
Cert 1
Code:
MIIF7DCCBNSgAwIBAgIQbsx6pacDIAm4zrz06VLUkTANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO

Cert 2
Code:
MIIF7DCCBNSgAwIBAgIQbsx6pacDIAm4zrz06VLUkTANBgkqhkiG9w0BAQUFADCB
yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL


These are duplicates and since they are aligned differently i could not do an extract and compare.

Your suggestions and inputs are most welcome.
If we ignore the line breaks, we can see that these two certs start with the same strings. But, the 1st cert ends with the characters:
Code:
ExZWZXJpU2lnbiBUcnVzdCBO

that do not appear in the 2nd cert. I don't see how you can say these certs are the same when one of them contains 24 more characters than the other one.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

An interactive way to delete duplicates

1)I am trying to write a script that works interactively lists duplicated records on certain field/column and asks user to delete one or more. And finally it deletes all the records the used has asked for. I have an idea to store those line numbers in an array, not sure how to do this in... (3 Replies)
Discussion started by: chvs2000
3 Replies

2. Shell Programming and Scripting

How can i delete the duplicates based on one column of a line

I have my data something like this (08/03/2009 22:57:42.414)(:) king aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb (08/03/2009 22:57:42.416)(:) John cccccccccccc cccccvssssssssss baaaaa (08/03/2009 22:57:42.417)(:) Michael ddddddd tststststtststts (08/03/2009 22:57:42.425)(:) Ravi... (11 Replies)
Discussion started by: rdhanek
11 Replies

3. Shell Programming and Scripting

how can I delete duplicates in the log?

I have a log file and I am trying to run a script against it to search for key issues such as invalid users, errors etc. In one part, I grep for session closed and get a lot of the same thing,, ie. root username etc. I want to remove the multiple root and just have it do a count, like wc -l ... (5 Replies)
Discussion started by: taekwondo
5 Replies

4. Shell Programming and Scripting

Delete duplicates via script?

Hello, i have the following problem: there are two folders with a lot of files. Example: FolderA contains AAA, BBB, CCC FolderB contains DDD, EEE, AAA How can i via script identify AAA as duplicate in Folder B and delete it there? So that only DDD and EEE remain, in Folder B? Thank you... (16 Replies)
Discussion started by: Y-T
16 Replies

5. Shell Programming and Scripting

Delete Duplicates on the basis of two column values.

Hi All, i need ti delete two duplicate processss which are running on the same device type (column 1) and port ID (column 2). here is the sample data p1sc1m1 15517 11325 0 01:00:24 ? 0:00 scagntclsx25octtcp 2967 in3v mvmp01 0 8000 N S 969 750@751@752@ p1sc1m1 15519 11325 0 01:00:24 ? ... (5 Replies)
Discussion started by: neeraj617
5 Replies

6. Shell Programming and Scripting

Fastest way to delete duplicates from a large filelist.....

OK I have two filelists...... The first is formatted like this.... /path/to/the/actual/file/location/filename.jpg and has up to a million records The second list shows filename.jpg where there is more then on instance. and has maybe up to 65,000 records I want to copy files... (4 Replies)
Discussion started by: Bashingaway
4 Replies

7. Shell Programming and Scripting

delete from line and remove duplicates

My Input.....file1 ABCDE4435 Connected to 107.71.136.122 (SubNetwork=ONRM_RootMo_R SubNetwork=XYVLTN29CRBR99 MeContext=ABCDE4435 ManagedElement=1) ABCDE4478 Connected to 166.208.30.57 (SubNetwork=ONRM_RootMo_R SubNetwork=KLFMTN29CR0R04 MeContext=ABCDE4478 ManagedElement=1) ABCDE4478... (5 Replies)
Discussion started by: pareshkp
5 Replies

8. Shell Programming and Scripting

Search for duplicates and delete but remain the first one based on a specific pattern

Hi all, I have been trying to delete duplicates based on a certain pattern but failed to make it works. There are more than 1 pattern which are duplicated but i just want to remove 1 pattern only and remain the rest. I cannot use awk '!x++' inputfile.txt or sed '/pattern/d' or use uniq and sort... (7 Replies)
Discussion started by: redse171
7 Replies

9. Shell Programming and Scripting

Delete only if duplicates found in each record

Hi, i have another problem. I have been trying to solve it by myself but failed. inputfile ;; ID T08578 NAME T08578 SBASE 30696 EBASE 32083 TYPE P func just test func chronology func cholesterol func null INT 30765-37333 INT 37154-37318 Link 5546 Link 8142 (4 Replies)
Discussion started by: redse171
4 Replies

10. Shell Programming and Scripting

To Delete the duplicates using Part of File Name

I am using the below script to delete duplicate files but it is not working for directories with more than 10k files "Argument is too long" is getting for ls -t. Tried to replace ls -t with find . -type f \( -iname "*.xml" \) -printf '%T@ %p\n' | sort -rg | sed -r 's/* //' | awk... (8 Replies)
Discussion started by: gold2k8
8 Replies
hx509 certificate store functions(3)				Heimdalx509library			      hx509 certificate store functions(3)

NAME
hx509 certificate store functions - Functions int hx509_certs_init (hx509_context context, const char *name, int flags, hx509_lock lock, hx509_certs *certs) int hx509_certs_store (hx509_context context, hx509_certs certs, int flags, hx509_lock lock) void hx509_certs_free (hx509_certs *certs) int hx509_certs_start_seq (hx509_context context, hx509_certs certs, hx509_cursor *cursor) int hx509_certs_next_cert (hx509_context context, hx509_certs certs, hx509_cursor cursor, hx509_cert *cert) int hx509_certs_end_seq (hx509_context context, hx509_certs certs, hx509_cursor cursor) int hx509_certs_iter_f (hx509_context context, hx509_certs certs, int(*func)(hx509_context, void *, hx509_cert), void *ctx) int hx509_ci_print_names (hx509_context context, void *ctx, hx509_cert c) int hx509_certs_add (hx509_context context, hx509_certs certs, hx509_cert cert) int hx509_certs_find (hx509_context context, hx509_certs certs, const hx509_query *q, hx509_cert *r) int hx509_certs_filter (hx509_context context, hx509_certs certs, const hx509_query *q, hx509_certs *result) int hx509_certs_merge (hx509_context context, hx509_certs to, hx509_certs from) int hx509_certs_append (hx509_context context, hx509_certs to, hx509_lock lock, const char *name) int hx509_get_one_cert (hx509_context context, hx509_certs certs, hx509_cert *c) int hx509_certs_info (hx509_context context, hx509_certs certs, int(*func)(void *, const char *), void *ctx) Detailed Description See the Certificate store operations for description and examples. Function Documentation int hx509_certs_add (hx509_context context, hx509_certs certs, hx509_cert cert) Add a certificate to the certificiate store. The receiving keyset certs will either increase reference counter of the cert or make a deep copy, either way, the caller needs to free the cert itself. Parameters: context a hx509 context. certs certificate store to add the certificate to. cert certificate to add. Returns: Returns an hx509 error code. int hx509_certs_append (hx509_context context, hx509_certs to, hx509_lock lock, const char * name) Same a hx509_certs_merge() but use a lock and name to describe the from source. Parameters: context a hx509 context. to the store to merge into. lock a lock that unlocks the certificates store, use NULL to select no password/certifictes/prompt lock (see Locking and unlocking certificates and encrypted data.). name name of the source store Returns: Returns an hx509 error code. int hx509_certs_end_seq (hx509_context context, hx509_certs certs, hx509_cursor cursor) End the iteration over certificates. Parameters: context a hx509 context. certs certificate store to iterate over. cursor cursor that will keep track of progress, freed. Returns: Returns an hx509 error code. int hx509_certs_filter (hx509_context context, hx509_certs certs, const hx509_query * q, hx509_certs * result) Filter certificate matching the query. Parameters: context a hx509 context. certs certificate store to search. q query allocated with hx509 query functions functions. result the filtered certificate store, caller must free with hx509_certs_free(). Returns: Returns an hx509 error code. Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query. int hx509_certs_find (hx509_context context, hx509_certs certs, const hx509_query * q, hx509_cert * r) Find a certificate matching the query. Parameters: context a hx509 context. certs certificate store to search. q query allocated with hx509 query functions functions. r return certificate (or NULL on error), should be freed with hx509_cert_free(). Returns: Returns an hx509 error code. Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query. void hx509_certs_free (hx509_certs * certs) Free a certificate store. Parameters: certs certificate store to free. int hx509_certs_info (hx509_context context, hx509_certs certs, int(*)(void *, const char *) func, void * ctx) Print some info about the certificate store. Parameters: context a hx509 context. certs certificate store to print information about. func function that will get each line of the information, if NULL is used the data is printed on a FILE descriptor that should be passed in ctx, if ctx also is NULL, stdout is used. ctx parameter to func. Returns: Returns an hx509 error code. int hx509_certs_init (hx509_context context, const char * name, int flags, hx509_lock lock, hx509_certs * certs) Open or creates a new hx509 certificate store. Parameters: context A hx509 context name name of the store, format is TYPE:type-specific-string, if NULL is used the MEMORY store is used. flags list of flags: o HX509_CERTS_CREATE create a new keystore of the specific TYPE. o HX509_CERTS_UNPROTECT_ALL fails if any private key failed to be extracted. lock a lock that unlocks the certificates store, use NULL to select no password/certifictes/prompt lock (see Locking and unlocking certificates and encrypted data.). certs return pointer, free with hx509_certs_free(). int hx509_certs_iter_f (hx509_context context, hx509_certs certs, int(*)(hx509_context, void *, hx509_cert) func, void * ctx) Iterate over all certificates in a keystore and call an function for each fo them. Parameters: context a hx509 context. certs certificate store to iterate over. func function to call for each certificate. The function should return non-zero to abort the iteration, that value is passed back to the caller of hx509_certs_iter_f(). ctx context variable that will passed to the function. Returns: Returns an hx509 error code. int hx509_certs_merge (hx509_context context, hx509_certs to, hx509_certs from) Merge a certificate store into another. The from store is keep intact. Parameters: context a hx509 context. to the store to merge into. from the store to copy the object from. Returns: Returns an hx509 error code. int hx509_certs_next_cert (hx509_context context, hx509_certs certs, hx509_cursor cursor, hx509_cert * cert) Get next ceritificate from the certificate keystore pointed out by cursor. Parameters: context a hx509 context. certs certificate store to iterate over. cursor cursor that keeps track of progress. cert return certificate next in store, NULL if the store contains no more certificates. Free with hx509_cert_free(). Returns: Returns an hx509 error code. int hx509_certs_start_seq (hx509_context context, hx509_certs certs, hx509_cursor * cursor) Start the integration Parameters: context a hx509 context. certs certificate store to iterate over cursor cursor that will keep track of progress, free with hx509_certs_end_seq(). Returns: Returns an hx509 error code. HX509_UNSUPPORTED_OPERATION is returned if the certificate store doesn't support the iteration operation. int hx509_certs_store (hx509_context context, hx509_certs certs, int flags, hx509_lock lock) Write the certificate store to stable storage. Parameters: context A hx509 context. certs a certificate store to store. flags currently unused, use 0. lock a lock that unlocks the certificates store, use NULL to select no password/certifictes/prompt lock (see Locking and unlocking certificates and encrypted data.). Returns: Returns an hx509 error code. HX509_UNSUPPORTED_OPERATION if the certificate store doesn't support the store operation. int hx509_ci_print_names (hx509_context context, void * ctx, hx509_cert c) Iterate over all certificates in a keystore and call an function for each fo them. Parameters: context a hx509 context. certs certificate store to iterate over. func function to call for each certificate. The function should return non-zero to abort the iteration, that value is passed back to the caller of hx509_certs_iter(). Returns: Returns an hx509 error code. Function to use to hx509_certs_iter_f() as a function argument, the ctx variable to hx509_certs_iter_f() should be a FILE file descriptor. Parameters: context a hx509 context. ctx used by hx509_certs_iter_f(). c a certificate Returns: Returns an hx509 error code. int hx509_get_one_cert (hx509_context context, hx509_certs certs, hx509_cert * c) Get one random certificate from the certificate store. Parameters: context a hx509 context. certs a certificate store to get the certificate from. c return certificate, should be freed with hx509_cert_free(). Returns: Returns an hx509 error code. Version 1.5.2 11 Jan 2012 hx509 certificate store functions(3)
All times are GMT -4. The time now is 02:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy