Skip to content

Fix java 25 compatibility #5880

Description

@ndr-brt

Feature Request

Currently the code can't be built with java 25 (see)
Because of an issue caused by the new AsymmetricKey interface that has been put between Key and PublicKey and PrivateKey.

This is just a matter to cast the AsymmetricKey to Key to make it work in java 25, it will still work for java 17/21 (though the ide will tell that the cast is unnecessary).
PemParser:

            return keyPairList
                    .stream()
                    .filter(Objects::nonNull) // PEM strings that only contain public keys would get eliminated here
                    .map(keyPair -> keyPair.getPrivate() != null ? keyPair.getPrivate() : keyPair.getPublic())
                    .findFirst()
                    .map(Result::success)
                    .orElseGet(() -> Result.failure("PEM-encoded structure did not contain a private key."))
                    .map(Key.class::cast); // this is the change needed

Which Areas Would Be Affected?

e.g., DPF, CI, build, transfer, etc.

Why Is the Feature Desired?

Are there any requirements?

Who will sponsor this feature?

Please @-mention the committer that will sponsor your feature.

Solution Proposal

If possible, provide a (brief!) solution proposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature_requestNew feature request, awaiting triagetriageall new issues awaiting classification

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions