Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62c1d286 authored by Janis Danisevskis's avatar Janis Danisevskis
Browse files

Keystore 2.0: KeyProperties SignaturePadding is now public but hidden

In anticipation of the new Keystore 2.0 SPI we made this nested class
public (like its siblings) so that the new SPI which resides in a
different package may access it. It is hidden though because it does not
constitute public API surface.

Test: None
Bug: 171305684
Change-Id: I1dbe3d02c03f97f843813c26c16aaef7152ca478
parent d2c944bc
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -496,10 +496,16 @@ public abstract class KeyProperties {
     */
    public static final String SIGNATURE_PADDING_RSA_PSS = "PSS";

    static abstract class SignaturePadding {
    /**
     * @hide
     */
    public abstract static class SignaturePadding {
        private SignaturePadding() {}

        static int toKeymaster(@NonNull @SignaturePaddingEnum String padding) {
        /**
         * @hide
         */
        public static int toKeymaster(@NonNull @SignaturePaddingEnum String padding) {
            switch (padding.toUpperCase(Locale.US)) {
                case SIGNATURE_PADDING_RSA_PKCS1:
                    return KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_SIGN;
@@ -512,7 +518,7 @@ public abstract class KeyProperties {
        }

        @NonNull
        static @SignaturePaddingEnum String fromKeymaster(int padding) {
        public static @SignaturePaddingEnum String fromKeymaster(int padding) {
            switch (padding) {
                case KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_SIGN:
                    return SIGNATURE_PADDING_RSA_PKCS1;
@@ -524,7 +530,7 @@ public abstract class KeyProperties {
        }

        @NonNull
        static int[] allToKeymaster(@Nullable @SignaturePaddingEnum String[] paddings) {
        public static int[] allToKeymaster(@Nullable @SignaturePaddingEnum String[] paddings) {
            if ((paddings == null) || (paddings.length == 0)) {
                return EmptyArray.INT;
            }