Skip to content

Certificate chain of length one is not retrieved #10

@mouse07410

Description

@mouse07410

When the token has only the leaf certificate but does not carry the entire chain (as most of the cryptographic tokens, such as smart cards do), the code throws an exception or returns null:

. . . . .
               Certificate certificate = ks.getCertificate(alias);   // this works
               System.out.println(" certificate=" + certificate);
               // the following either throws an exception on trying to fetch certificate
               // of the issuer, or simply returns null
               Certificate [] chain = ks.getCertificateChain(alias);
. . . . .

The correct (and expected) result would be Certificate[] chain having one entry - the leaf certificate itself. That's how SunPKCS11 provider behaves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions