3 use Convert::ASN1 qw(:tag);
4 use Digest::MD5 qw(md5);
8 $encoded=encode_object_id($oid);
10 @entries=unpack("C*",$encoded);
11 shift @entries; # Get rid of the NULL
13 print "DER representation: ";
14 foreach $entry (@entries) {
20 $digest = md5($encoded);
21 # We only want the first 10 characters;
22 # Conversations with the authors suggest that we want to use all of the
23 # characters of the digest.
24 #$digest = substr($digest,0,10);
25 print "gsskeyex representation: ",encode_base64($digest),"\n";
27 sub encode_object_id {
30 my @data = ($_[0] =~ /(\d+)/g);
36 my $first = $data[1] + ($data[0] * 40);
37 splice(@data,0,2,$first);
40 # my $l = length $string;
41 $string .= pack("cw*", 0, @data);
42 # substr($string,$l,1) = asn_encode_length(length($string) - $l - 1);