<commit_before># OpenXPKI::Server::Workflow::Activity::SCEPv2::LoadRecentCertificate
# Written by <NAME> for the OpenXPKI project 2013
# Copyright (c) 2013 by The OpenXPKI Project

package OpenXPKI::Server::Workflow::Activity::SCEPv2::LoadRecentCertificate;

use strict;
use base qw( OpenXPKI::Server::Workflow::Activity );

use OpenXPKI::Server::Context qw( CTX );
use OpenXPKI::Exception;
use OpenXPKI::Debug;
use OpenXPKI::Crypto::CSR;
use OpenXPKI::Serialization::Simple;

use Data::Dumper;

sub execute {
    ##! 1: 'start'
    my ($self, $workflow) = @_;
    my $pki_realm  = CTX('session')->get_pki_realm();
    my $serializer = OpenXPKI::Serialization::Simple->new();
    my $context    = $workflow->context();

    my $cert_identifier = $self->param('cert_identifier');

    my $dbi = CTX('dbi');

    # select current certificate from database
    my $cert = $dbi->select_one(
        from => 'certificate',
        columns => [ 'subject', 'req_key', 'notbefore', 'notafter' ],
        where => {
            identifier => $cert_identifier,
            status    => 'ISSUED',
        },
    );

    $context->param('cert_subject' => $cert->{subject});

    # select subject alt names from database
    my $sth = $dbi->select(
        from   => 'certificate_attributes',
        columns => [ 'attribute_value' ],
        where => {
            attribute_contentkey => 'subject_alt_name',
            identifier           => $cert_identifier,
        },
    );

    my @subject_alt_names;
    while (my $san = $sth->fetchrow_hashref) {
        my @split = split q{:}, $san->{attribute_value};
        push @subject_alt_names, \@split;<commit_msg>Fix broken revokcation identifier in  ..::SCEPv2::LoadRecentCertificate<commit_after># OpenXPKI::Server::Workflow::Activity::SCEPv2::LoadRecentCertificate
# Written by <NAME> for the OpenXPKI project 2013
# Copyright (c) 2013 by The OpenXPKI Project

package OpenXPKI::Server::Workflow::Activity::SCEPv2::LoadRecentCertificate;

use strict;
use base qw( OpenXPKI::Server::Workflow::Activity );

use OpenXPKI::Server::Context qw( CTX );
use OpenXPKI::Exception;
use OpenXPKI::Debug;
use OpenXPKI::Crypto::CSR;
use OpenXPKI::Serialization::Simple;

use Data::Dumper;

sub execute {
    ##! 1: 'start'
    my ($self, $workflow) = @_;
    my $pki_realm  = CTX('session')->get_pki_realm();
    my $serializer = OpenXPKI::Serialization::Simple->new();
    my $context    = $workflow->context();

    my $cert_identifier = $self->param('cert_identifier');

    my $dbi = CTX('dbi');

    # select current certificate from database
    my $cert = $dbi->select_one(
        from => 'certificate',
        columns => [ 'subject', 'req_key', 'notbefore', 'notafter', 'identifier' ],
        where => {
            identifier => $cert_identifier,
            status    => 'ISSUED',
        },
    );

    $context->param('cert_subject' => $cert->{subject});

    # select subject alt names from database
    my $sth = $dbi->select(
        from   => 'certificate_attributes',
        columns => [ 'attribute_value' ],
        where => {
            attribute_contentkey => 'subject_alt_name',
            identifier           => $cert_identifier,
        },
    );

    my @subject_alt_names;
    while (my $san = $sth->fetchrow_hashref) {
        my @split = split q{:}, $san->{attribute_value};
        push @subject_alt_names, \@split;
{'fraction_non_alphanumeric': 0.15059171597633136, 'fraction_numerical': 0.006804733727810651, 'mean_word_length': 3.301526717557252, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1795803', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1073, 'n_words': 235}