Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# IDPSSO X509 fingerprint
Compute x509 fingerprint from IDPSSO xml file.

## Requirements

* Perl
* `openssl`
* `cut`

## Manual

1. Download an IDPSSO configuration file from your keycloak instance in the installation tab.
2. execute:
```./x509_fingerprint.sh path_to_your_IDPSSO_file.xml```
3. Et Voilà !
1. Download an IDPSSODescriptor or SPSSODescriptor configuration file from your keycloak instance (see "Installation" tab of a client).
2. Execute the script: `./x509_fingerprint.sh path_to_your_IDPSSO_file.xml`
3. Et Voilà !
8 changes: 5 additions & 3 deletions x509_fingerprint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

BASE_DIR="$(dirname "$0")"
$BASE_DIR/x509_pem_extractor.pl $@ | openssl x509 -noout -fingerprint -sha1
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
"$BASE_DIR/x509_pem_extractor.pl" "$@" | \
openssl x509 -noout -fingerprint -sha1 | \
cut -d'=' -f2
6 changes: 3 additions & 3 deletions x509_pem_extractor.pl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl

use strict;
use warnings;
Expand Down Expand Up @@ -28,8 +28,8 @@
my $count = floor((length $result)/64);
for (my $i = 0; $i <= $count; $i++) {
my $str = substr $result, ($i*64), 64;
$start = $start . "\n" . $str
$start = $start . "\n" . $str
}

$start = $start . "\n" . $end . "\n";
print $start;
print $start;