home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / SSH.pm < prev    next >
Encoding:
Perl POD Document  |  2003-01-08  |  882 b   |  37 lines

  1. #!/usr/bin/perl -sw
  2. ##
  3. ## Crypt::RSA::Key::Private::SSH
  4. ##
  5. ## Copyright (c) 2001, Vipul Ved Prakash.  All rights reserved.
  6. ## This code is free software; you can redistribute it and/or modify
  7. ## it under the same terms as Perl itself.
  8. ##
  9. ## $Id: SSH.pm,v 1.1 2001/05/20 23:37:48 vipul Exp $
  10.  
  11. package Crypt::RSA::Key::Public::SSH;
  12. use strict;
  13. use lib qw(lib);
  14. use Crypt::RSA::DataFormat qw(bitsize);
  15. use Crypt::RSA::Key::Public;
  16. use vars qw(@ISA);
  17. @ISA = qw(Crypt::RSA::Key::Public);
  18.  
  19. sub deserialize {
  20.     my ($self, %params) = @_;
  21.     my ($bitsize, $e, $n, $ident) = split /\s/, join'',@{$params{String}};
  22.     $self->n ($n);
  23.     $self->e ($e);
  24.     $self->Identity ($ident);
  25.     return $self;
  26. }
  27.  
  28. sub serialize { 
  29.     my ($self, %params) = @_;
  30.     my $bitsize = bitsize ($self->n);
  31.     my $string = join ' ', $bitsize, $self->e, $self->n, $self->Identity;
  32.     return $string;
  33. }
  34.  
  35. 1;
  36.  
  37.