[otrs-cvs]
CVS: otrs/Kernel/System/Crypt PGP.pm, 1.12, 1.13 SMIME.pm, 1.9, 1.10
cvs-log at otrs.org
cvs-log at otrs.org
Thu Dec 14 13:09:51 CET 2006
Update of /home/cvs/otrs/Kernel/System/Crypt
In directory lancelot:/tmp/cvs-serv26954/Kernel/System/Crypt
Modified Files:
PGP.pm SMIME.pm
Log Message:
improved style of syntax
Index: PGP.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Crypt/PGP.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** PGP.pm 29 Aug 2006 17:31:04 -0000 1.12
--- PGP.pm 14 Dec 2006 12:09:49 -0000 1.13
***************
*** 33,41 ****
# just for internal
! sub Init {
my $Self = shift;
my %Param = @_;
-
$Self->{GPGBin} = $Self->{ConfigObject}->Get('PGP::Bin') || '/usr/bin/gpg';
$Self->{Options} = $Self->{ConfigObject}->Get('PGP::Options') || '--batch --no-tty --yes';
--- 33,40 ----
# just for internal
! sub _Init {
my $Self = shift;
my %Param = @_;
$Self->{GPGBin} = $Self->{ConfigObject}->Get('PGP::Bin') || '/usr/bin/gpg';
$Self->{Options} = $Self->{ConfigObject}->Get('PGP::Options') || '--batch --no-tty --yes';
***************
*** 50,54 ****
check if environment is working
! my $Message = $CryptObject->Check();
=cut
--- 49,53 ----
check if environment is working
! my $Message = $CryptObject->Check();
=cut
***************
*** 71,78 ****
crypt a message
! my $Message = $CryptObject->Crypt(
! Message => $Message,
! Key => $PGPPublicKeyID,
! );
=cut
--- 70,77 ----
crypt a message
! my $Message = $CryptObject->Crypt(
! Message => $Message,
! Key => $PGPPublicKeyID,
! );
=cut
***************
*** 85,92 ****
# check needed stuff
foreach (qw(Message Key)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($FH, $Filename) = $Self->{FileTempObject}->TempFile();
--- 84,91 ----
# check needed stuff
foreach (qw(Message Key)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($FH, $Filename) = $Self->{FileTempObject}->TempFile();
***************
*** 117,123 ****
decrypt a message and returns a hash (Successful, Message, Data)
! my %Message = $CryptObject->Decrypt(
! Message => $CryptedMessage,
! );
=cut
--- 116,122 ----
decrypt a message and returns a hash (Successful, Message, Data)
! my %Message = $CryptObject->Decrypt(
! Message => $CryptedMessage,
! );
=cut
***************
*** 130,137 ****
# check needed stuff
foreach (qw(Message)) {
! if (!defined($Param{$_})) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($FH, $Filename) = $Self->{FileTempObject}->TempFile();
--- 129,136 ----
# check needed stuff
foreach (qw(Message)) {
! if (!defined($Param{$_})) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($FH, $Filename) = $Self->{FileTempObject}->TempFile();
***************
*** 184,192 ****
sign a message
! my $Sign = $CryptObject->Sign(
! Message => $Message,
! Key => $PGPPrivateKeyID,
! Type => 'Detached' # Detached|Inline
! );
=cut
--- 183,191 ----
sign a message
! my $Sign = $CryptObject->Sign(
! Message => $Message,
! Key => $PGPPrivateKeyID,
! Type => 'Detached' # Detached|Inline
! );
=cut
***************
*** 200,207 ****
# check needed stuff
foreach (qw(Message Key)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my $Pw = '';
--- 199,206 ----
# check needed stuff
foreach (qw(Message Key)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my $Pw = '';
***************
*** 248,261 ****
Inline sign:
! my %Data = $CryptObject->Verify(
! Message => $Message,
! );
Attached sign:
! my %Data = $CryptObject->Verify(
! Message => $Message,
! Sign => $Sign,
! );
=cut
--- 247,260 ----
Inline sign:
! my %Data = $CryptObject->Verify(
! Message => $Message,
! );
Attached sign:
! my %Data = $CryptObject->Verify(
! Message => $Message,
! Sign => $Sign,
! );
=cut
***************
*** 308,314 ****
returns a array with serach result (private and public keys)
! my @Keys = $CryptObject->KeySearch(
! Search => 'something to search'
! );
=cut
--- 307,313 ----
returns a array with serach result (private and public keys)
! my @Keys = $CryptObject->KeySearch(
! Search => 'something to search'
! );
=cut
***************
*** 327,333 ****
returns a array with serach result (private keys)
! my @Keys = $CryptObject->PrivateKeySearch(
! Search => 'something to search'
! );
=cut
--- 326,332 ----
returns a array with serach result (private keys)
! my @Keys = $CryptObject->PrivateKeySearch(
! Search => 'something to search'
! );
=cut
***************
*** 383,389 ****
returns a array with serach result (public keys)
! my @Keys = $CryptObject->PublicKeySearch(
! Search => 'something to search'
! );
=cut
--- 382,388 ----
returns a array with serach result (public keys)
! my @Keys = $CryptObject->PublicKeySearch(
! Search => 'something to search'
! );
=cut
***************
*** 433,439 ****
returns public key in ascii
! my $Key = $CryptObject->PublicKeyGet(
! Key => $KeyID,
! );
=cut
--- 432,438 ----
returns public key in ascii
! my $Key = $CryptObject->PublicKeyGet(
! Key => $KeyID,
! );
=cut
***************
*** 458,464 ****
returns secret key in ascii
! my $Key = $CryptObject->SecretKeyGet(
! Key => $KeyID,
! );
=cut
--- 457,463 ----
returns secret key in ascii
! my $Key = $CryptObject->SecretKeyGet(
! Key => $KeyID,
! );
=cut
***************
*** 483,489 ****
remove public key from key ring
! $CryptObject->PublicKeyDelete(
! Key => $KeyID,
! );
=cut
--- 482,488 ----
remove public key from key ring
! $CryptObject->PublicKeyDelete(
! Key => $KeyID,
! );
=cut
***************
*** 508,514 ****
remove secret key from key ring
! $CryptObject->SecretKeyDelete(
! Key => $KeyID,
! );
=cut
--- 507,513 ----
remove secret key from key ring
! $CryptObject->SecretKeyDelete(
! Key => $KeyID,
! );
=cut
***************
*** 533,539 ****
add key to key ring
! my $Message = $CryptObject->KeyAdd(
! Key => $KeyString,
! );
=cut
--- 532,538 ----
add key to key ring
! my $Message = $CryptObject->KeyAdd(
! Key => $KeyString,
! );
=cut
***************
*** 580,583 ****
--- 579,584 ----
1;
+ =back
+
=head1 TERMS AND CONDITIONS
Index: SMIME.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Crypt/SMIME.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** SMIME.pm 29 Aug 2006 17:31:04 -0000 1.9
--- SMIME.pm 14 Dec 2006 12:09:49 -0000 1.10
***************
*** 32,36 ****
=cut
! sub Init {
my $Self = shift;
my %Param = @_;
--- 32,36 ----
=cut
! sub _Init {
my $Self = shift;
my %Param = @_;
***************
*** 54,58 ****
check if environment is working
! my $Message = $CryptObject->Check();
=cut
--- 54,58 ----
check if environment is working
! my $Message = $CryptObject->Check();
=cut
***************
*** 92,99 ****
crypt a message
! my $Message = $CryptObject->Crypt(
! Message => $Message,
! Hash => $CertificateHash,
! );
=cut
--- 92,99 ----
crypt a message
! my $Message = $CryptObject->Crypt(
! Message => $Message,
! Hash => $CertificateHash,
! );
=cut
***************
*** 106,113 ****
# check needed stuff
foreach (qw(Message Hash)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my $Certificate = $Self->CertificateGet(%Param);
--- 106,113 ----
# check needed stuff
foreach (qw(Message Hash)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my $Certificate = $Self->CertificateGet(%Param);
***************
*** 140,147 ****
decrypt a message and returns a hash (Successful, Message, Data)
! my %Message = $CryptObject->Decrypt(
! Message => $CryptedMessage,
! Hash => $PrivateKeyHash,
! );
=cut
--- 140,147 ----
decrypt a message and returns a hash (Successful, Message, Data)
! my %Message = $CryptObject->Decrypt(
! Message => $CryptedMessage,
! Hash => $PrivateKeyHash,
! );
=cut
***************
*** 154,161 ****
# check needed stuff
foreach (qw(Message Hash)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($Private, $Secret) = $Self->PrivateGet(%Param);
--- 154,161 ----
# check needed stuff
foreach (qw(Message Hash)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($Private, $Secret) = $Self->PrivateGet(%Param);
***************
*** 199,206 ****
sign a message
! my $Sign = $CryptObject->Sign(
! Message => $Message,
! Hash => $PrivateKeyHash,
! );
=cut
--- 199,206 ----
sign a message
! my $Sign = $CryptObject->Sign(
! Message => $Message,
! Hash => $PrivateKeyHash,
! );
=cut
***************
*** 213,220 ****
# check needed stuff
foreach (qw(Message Hash)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($Private, $Secret) = $Self->PrivateGet(%Param);
--- 213,220 ----
# check needed stuff
foreach (qw(Message Hash)) {
! if (!$Param{$_}) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
! return;
! }
}
my ($Private, $Secret) = $Self->PrivateGet(%Param);
***************
*** 250,256 ****
verify a message with signature and returns a hash (Successful, Message, SignerCertificate)
! my %Data = $CryptObject->Verify(
! Message => $Message,
! );
=cut
--- 250,256 ----
verify a message with signature and returns a hash (Successful, Message, SignerCertificate)
! my %Data = $CryptObject->Verify(
! Message => $Message,
! );
=cut
***************
*** 332,338 ****
search a certifcate or an private key
! my @Result = $CryptObject->Search(
! Search => 'some text to search',
! );
=cut
--- 332,338 ----
search a certifcate or an private key
! my @Result = $CryptObject->Search(
! Search => 'some text to search',
! );
=cut
***************
*** 350,356 ****
search a local certifcate
! my @Result = $CryptObject->CertificateSearch(
! Search => 'some text to search',
! );
=cut
--- 350,356 ----
search a local certifcate
! my @Result = $CryptObject->CertificateSearch(
! Search => 'some text to search',
! );
=cut
***************
*** 387,393 ****
add a certificate to local certificates
! $CryptObject->CertificateAdd(
! Certificate => $CertificateString,
! );
=cut
--- 387,393 ----
add a certificate to local certificates
! $CryptObject->CertificateAdd(
! Certificate => $CertificateString,
! );
=cut
***************
*** 424,430 ****
get a local certificate
! my $Certificate = $CryptObject->CertificateGet(
! Hash => $CertificateHash,
! );
=cut
--- 424,430 ----
get a local certificate
! my $Certificate = $CryptObject->CertificateGet(
! Hash => $CertificateHash,
! );
=cut
***************
*** 457,463 ****
remove a local certificate
! $CryptObject->CertificateRemove(
! Hash => $CertificateHash,
! );
=cut
--- 457,463 ----
remove a local certificate
! $CryptObject->CertificateRemove(
! Hash => $CertificateHash,
! );
=cut
***************
*** 479,483 ****
get list of local certificates
! my @HashList = $CryptObject->CertificateList();
=cut
--- 479,483 ----
get list of local certificates
! my @HashList = $CryptObject->CertificateList();
=cut
***************
*** 489,495 ****
my @List = glob("$Self->{CertPath}/*.0");
foreach my $File (@List) {
! $File =~ s!^.*/!!;
! $File =~ s/(.*)\.0/$1/;
! push (@Hash, $File);
}
return @Hash;
--- 489,495 ----
my @List = glob("$Self->{CertPath}/*.0");
foreach my $File (@List) {
! $File =~ s!^.*/!!;
! $File =~ s/(.*)\.0/$1/;
! push (@Hash, $File);
}
return @Hash;
***************
*** 500,506 ****
get certificate attributes
! my %CertificateArrtibutes = $CryptObject->CertificateAttributes(
! Certificate => $CertificateString,
! );
=cut
--- 500,506 ----
get certificate attributes
! my %CertificateArrtibutes = $CryptObject->CertificateAttributes(
! Certificate => $CertificateString,
! );
=cut
***************
*** 622,628 ****
returns private keys
! my @Result = $CryptObject->PrivateSearch(
! Search => 'some text to search',
! );
=cut
--- 622,628 ----
returns private keys
! my @Result = $CryptObject->PrivateSearch(
! Search => 'some text to search',
! );
=cut
***************
*** 661,668 ****
add private key
! my $Message = $CryptObject->PrivateAdd(
! Private => $PrivateKeyString,
! Secret => 'Password',
! );
=cut
--- 661,668 ----
add private key
! my $Message = $CryptObject->PrivateAdd(
! Private => $PrivateKeyString,
! Secret => 'Password',
! );
=cut
***************
*** 685,693 ****
my @Certificates = $Self->CertificateSearch(Search => $Attributes{Modulus});
if (!@Certificates) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Need Certificate of Private Key first -$Attributes{Modulus})!");
return;
}
elsif ($#Certificates > 0) {
! $Self->{LogObject}->Log(Priority => 'error', Message => "Multible Certificates with the same Modulus, can't add Private Key!");
return;
}
--- 685,699 ----
my @Certificates = $Self->CertificateSearch(Search => $Attributes{Modulus});
if (!@Certificates) {
! $Self->{LogObject}->Log(
! Priority => 'error',
! Message => "Need Certificate of Private Key first -$Attributes{Modulus})!",
! );
return;
}
elsif ($#Certificates > 0) {
! $Self->{LogObject}->Log(
! Priority => 'error',
! Message => "Multible Certificates with the same Modulus, can't add Private Key!",
! );
return;
}
***************
*** 721,727 ****
get private key
! my ($PrivateKey, $Secret) = $CryptObject->PrivateGet(
! Hash => $PrivateKeyHash,
! );
=cut
--- 727,733 ----
get private key
! my ($PrivateKey, $Secret) = $CryptObject->PrivateGet(
! Hash => $PrivateKeyHash,
! );
=cut
***************
*** 768,774 ****
remove private key
! $CryptObject->PrivateRemove(
! Hash => $PrivateKeyHash,
! );
=cut
--- 774,780 ----
remove private key
! $CryptObject->PrivateRemove(
! Hash => $PrivateKeyHash,
! );
=cut
***************
*** 791,795 ****
returns a list of private key hashs
! my @Hash = $CryptObject->PrivateList();
=cut
--- 797,801 ----
returns a list of private key hashs
! my @Hash = $CryptObject->PrivateList();
=cut
***************
*** 801,807 ****
my @List = glob("$Self->{PrivatePath}/*.0");
foreach my $File (@List) {
! $File =~ s!^.*/!!;
! $File =~ s/(.*)\.0/$1/;
! push (@Hash, $File);
}
return @Hash;
--- 807,813 ----
my @List = glob("$Self->{PrivatePath}/*.0");
foreach my $File (@List) {
! $File =~ s!^.*/!!;
! $File =~ s/(.*)\.0/$1/;
! push (@Hash, $File);
}
return @Hash;
***************
*** 813,820 ****
returns attributes of private key
! my %Hash = $CryptObject->PrivateAttributes(
! Private => $PrivateKeyString,
! Secret => 'Password',
! );
=cut
--- 819,826 ----
returns attributes of private key
! my %Hash = $CryptObject->PrivateAttributes(
! Private => $PrivateKeyString,
! Secret => 'Password',
! );
=cut
***************
*** 856,859 ****
--- 862,867 ----
1;
+ =back
+
=head1 TERMS AND CONDITIONS
More information about the cvs-log
mailing list