
Net::SSH::AuthorizedKey - Holds a single line of the authorized_keys file

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',
);

Net::SSH::AuthorizedKey objects holds key lines from ssh's authorized_keys files. They just provide getter/setter methods.

optionGet/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_deleteRemove an option completely. $ak->option_delete("from") will remove the from option from the key meta info.
typeType of ssh key, either "ssh-1" or "ssh-2".
emailEmail address of the person who created the key. (Different from the "from" option).
keyPublic key, either a long number (ssh-1) or a line of alphanumeric characters.
keylenLength of the key in bit (e.g. 1024).
exponentTwo-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.

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.

2005, Mike Schilli <m@perlmeister.com>