jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java
changeset 23582 d5fa3327ab3a
parent 22121 b1aa108cccb5
equal deleted inserted replaced
23581:0ca496340112 23582:d5fa3327ab3a
    28 import java.security.AccessController;
    28 import java.security.AccessController;
    29 import java.security.PrivilegedAction;
    29 import java.security.PrivilegedAction;
    30 import java.security.Provider;
    30 import java.security.Provider;
    31 import java.util.HashMap;
    31 import java.util.HashMap;
    32 import java.util.Map;
    32 import java.util.Map;
    33 
       
    34 import sun.security.action.PutAllAction;
       
    35 
       
    36 
    33 
    37 /**
    34 /**
    38  * A Cryptographic Service Provider for the Microsoft Crypto API.
    35  * A Cryptographic Service Provider for the Microsoft Crypto API.
    39  *
    36  *
    40  * @since 1.6
    37  * @since 1.6
   138         map.put("Cipher.RSA SupportedModes", "ECB");
   135         map.put("Cipher.RSA SupportedModes", "ECB");
   139         map.put("Cipher.RSA SupportedPaddings", "PKCS1PADDING");
   136         map.put("Cipher.RSA SupportedPaddings", "PKCS1PADDING");
   140         map.put("Cipher.RSA SupportedKeyClasses", "sun.security.mscapi.Key");
   137         map.put("Cipher.RSA SupportedKeyClasses", "sun.security.mscapi.Key");
   141 
   138 
   142         if (map != this) {
   139         if (map != this) {
   143             AccessController.doPrivileged(new PutAllAction(this, map));
   140             final Provider provider = this;
       
   141             PrivilegedAction<Void> putAllAction = () -> {
       
   142                 provider.putAll(map);
       
   143                 return null;
       
   144             };
       
   145             AccessController.doPrivileged(putAllAction);
   144         }
   146         }
   145     }
   147     }
   146 }
   148 }