| 6 | // |
| 7 | // https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 |
| 15 | #include <openssl/rsa.h> |
| 16 |
| 17 | #include <openssl/evp.h> |
| 18 |
| 19 |
| 20 | int RSA_print(BIO *bio, const RSA *rsa, int indent) { |
| 21 | EVP_PKEY *pkey = EVP_PKEY_new(); |
| 22 | int ret = pkey != NULL && |
| 23 | EVP_PKEY_set1_RSA(pkey, (RSA *)rsa) && |
| 24 | EVP_PKEY_print_private(bio, pkey, indent, NULL); |
| 25 | EVP_PKEY_free(pkey); |
| 26 | return ret; |
| 27 | } |
| 28 |