Skip to content

B_BES (baseline) profile and invalid signature #114

@heikih

Description

@heikih

I'm trying to create BDOC container with B_EPES profile and tested adding invalid signature.

I have following code for signing:

var dataToSign  = SignatureBuilder
                .aSignature(bDocContainer)
                .withSignatureProfile(SignatureProfile.B_EPES)
                .withSigningCertificate(certificate)
                .withSignatureDigestAlgorithm(DigestAlgorithm.SHA256)
                .buildDataToSign();

Signature signature = dataToSign.finalize(signatureBytes);

bDocContainer.addSignature(signature);

If signatureBytes is invalid then bDocContainer.addSignature(signature) doesnt throw exception, same line throws exception if using LT_TM profile.

Is this so by design or is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions