Skip to content

Not possible to use HexEncodingTextEncryptor with BouncyCastleAesCbcBytesEncryptor #4049

@TobiX

Description

@TobiX

Summary

In org.springframework.security.crypto.encrypt.Encryptors there are nice wrappers for HexEncodingTextEncryptor with AesBytesEncryptor if you want to use JCE (and always install the unlimited stength policy file into the JRE), but none such wrappers for the new BouncyCastle counterparts.

Actual Behavior

No way to create hex-encoded encrypted strings with bouncycastle alone.

Expected Behavior

I'd like a convenient API to use those encryptors. I think @tfnico mentioned an additional builder class in #2917 already, which could be a basis for this functionality.

Configuration

Version

4.1.3, but this is a design issue

Sample

I could make HexEncodingTextEncryptor public and use it directly from my code:

new HexEncodingTextEncryptor (new BouncyCastleAesCbcBytesEncryptor (p, s))

I don't think this should be the public API...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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