Skip to content

Commit

Permalink
Merge pull request #199 from mitwork/email-attribute-parse-issue
Browse files Browse the repository at this point in the history
Корректная обработка email в CertificateWrapper
  • Loading branch information
malikzh authored Aug 22, 2024
2 parents 9dd4785 + 330339e commit 2fa8baf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/kz/ncanode/wrapper/CertificateWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ private static Optional<CertificateSubject> createCertificateSubjectFromDn(Strin
subjectBuilder.locality((String)rdn.getValue());
} else if (rdn.getType().equalsIgnoreCase("S")) {
subjectBuilder.state((String)rdn.getValue());
} else if (rdn.getType().equalsIgnoreCase("E")) {
} else if ((rdn.getType().equalsIgnoreCase("E")) || (rdn.getType().equalsIgnoreCase("EMAILADDRESS"))) {
subjectBuilder.email((String)rdn.getValue());
} else if (rdn.getType().equalsIgnoreCase("O")) {
subjectBuilder.organization((String)rdn.getValue());
Expand All @@ -276,7 +276,7 @@ private static Optional<CertificateSubject> createCertificateSubjectFromDn(Strin

return Optional.of(subjectBuilder.build());
} catch (InvalidNameException e) {
log.warn("Distinguished name parseing error", e);
log.warn("Distinguished name parsing error", e);
return Optional.empty();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CertificateServiceTest extends Specification implements WithTestData {
result.signers.size() == 1
}

def "invalid cetificate info method"() {
def "invalid certificate info method"() {
given:
def certs = [
"YXNkYXNk"
Expand Down

0 comments on commit 2fa8baf

Please sign in to comment.