« blib/lib/Crypt/Perl/X/ASN1/Encode.pm
↑ Summary
blib/lib/Crypt/Perl/X/ECDSA/NoCurveForNISTName.pm »
| 1 | package Crypt::Perl::X::ASN1::Prepare; | ||
| 2 | |||
| 3 | #This shouldn’t happen as long as the templates come from this library. | ||
| 4 | #But, for completeness … | ||
| 5 | |||
| 6 | use strict; | ||
| 7 | use warnings; | ||
| 8 | |||
| 9 | use parent 'Crypt::Perl::X::Base'; | ||
| 10 | |||
| 11 | sub new { | ||
| 12 | my ($class, $template, $error) = @_; | ||
| 13 | |||
| 14 | my $tfrag = substr( $template, 0, 32 ); | ||
| 15 | $tfrag =~ tr<\r\n>< >s; | ||
| 16 | |||
| 17 | return $class->SUPER::new( "Failed to prepare ASN.1 template ($tfrag): $error", { asn => $template, error => $error } ); | ||
| 18 | } | ||
| 19 | |||
| 20 | 1; |