< prev index next >
src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 42,58 ****
import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
import sun.security.util.KeyUtil;
/**
* RSA cipher implementation. Supports RSA en/decryption and signing/verifying
! * using PKCS#1 v1.5 padding and without padding (raw RSA). Note that raw RSA
! * is supported mostly for completeness and should only be used in rare cases.
*
* Objects should be instantiated by calling Cipher.getInstance() using the
* following algorithm names:
! * . "RSA/ECB/PKCS1Padding" (or "RSA") for PKCS#1 padding. The mode (blocktype)
! * is selected based on the en/decryption mode and public/private key used
* . "RSA/ECB/NoPadding" for rsa RSA.
*
* We only do one RSA operation per doFinal() call. If the application passes
* more data via calls to update() or doFinal(), we throw an
* IllegalBlockSizeException when doFinal() is called (see JCE API spec).
--- 42,60 ----
import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
import sun.security.util.KeyUtil;
/**
* RSA cipher implementation. Supports RSA en/decryption and signing/verifying
! * using both PKCS#1 v1.5 and OAEP (v2.2) paddings and without padding (raw RSA).
! * Note that raw RSA is supported mostly for completeness and should only be
! * used in rare cases.
*
* Objects should be instantiated by calling Cipher.getInstance() using the
* following algorithm names:
! * . "RSA/ECB/PKCS1Padding" (or "RSA") for PKCS#1 v1.5 padding.
! * . "RSA/ECB/OAEPwith<hash>andMGF1Padding" (or "RSA/ECB/OAEPPadding") for
! * PKCS#1 v2.2 padding.
* . "RSA/ECB/NoPadding" for rsa RSA.
*
* We only do one RSA operation per doFinal() call. If the application passes
* more data via calls to update() or doFinal(), we throw an
* IllegalBlockSizeException when doFinal() is called (see JCE API spec).
*** 79,89 ****
// constant for raw RSA
private static final String PAD_NONE = "NoPadding";
// constant for PKCS#1 v1.5 RSA
private static final String PAD_PKCS1 = "PKCS1Padding";
! // constant for PKCS#2 v2.0 OAEP with MGF1
private static final String PAD_OAEP_MGF1 = "OAEP";
// current mode, one of MODE_* above. Set when init() is called
private int mode;
--- 81,91 ----
// constant for raw RSA
private static final String PAD_NONE = "NoPadding";
// constant for PKCS#1 v1.5 RSA
private static final String PAD_PKCS1 = "PKCS1Padding";
! // constant for PKCS#2 v2.2 OAEP with MGF1
private static final String PAD_OAEP_MGF1 = "OAEP";
// current mode, one of MODE_* above. Set when init() is called
private int mode;
< prev index next >