NAME
Net::SSH::AuthorizedKey - Holds a single line of the authorized_keys file
SYNOPSIS
use Net::SSH::AuthorizedKey;
my $akf = Net::SSH::AuthorizedKey->new(
options => { from => 'foo@bar.com', "no-agent-forwarding" },
key => "123....890",
keylen => 1024,
exponent => 35,
type => "ssh-1",
email => 'issuer@issuer.com',
);
DESCRIPTION
Net::SSH::AuthorizedKey objects holds key lines from ssh's authorized_keys files. They just provide getter/setter methods.
METHODS
option
-
Get/set an option. Note that options can be either binary or carry a string:
# Set "no-agent-forwarding" option $ak->option("no-agent-forwarding", 1); # Check if no-agent-forwarding option is set if($ak->option("no-agent-forwarding")) { # ... } # Set the from option to 'from="a@b.com"' $ak->option(from => 'a@b.com'); # Get the value of the 'from' option my $val = $ak->option("from");
option_delete
-
Remove an option completely.
$ak->option_delete("from")
will remove thefrom
option from the key meta info. type
-
Type of ssh key, either
"ssh-1"
or"ssh-2"
. email
-
Email address of the person who created the key. (Different from the "from" option).
key
-
Public key, either a long number (ssh-1) or a line of alphanumeric characters.
keylen
-
Length of the key in bit (e.g. 1024).
exponent
-
Two-digit number in front of the key in ssh-1 keys.
Calling a method will return undef
if the corresponding entry doesn't exist in the key meta data.
LEGALESE
Copyright 2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
2005, Mike Schilli <m@perlmeister.com>