Native PKCS11 mechanisms which support decryption but not encryption or signature verification but not signing are considered legacy and are disabled by default. The legacy mechanism check in SunPKCS11 provider is enhanced with the service type. For example, prior to this fix, a mechanism supporting encryption, decryption, and verification but not signing, is considered legacy and can't be used at all. After this fix, the corresponding Cipher service using this mechanism is available since both encryption and decryption are supported. However, the corresponding Signature service is not since only verification is supported. To bypass the legacy mechanism check, set the PKCS11 provider configuration attribute "allowLegacy" to true (default value: false). Note that it is the caller's responsibility to make sure the legacy mechanism is not used for the unsupported functionality, e.g. use this mechanism to sign.