1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/cert/internal/signature_policy.h"
7 #include "base/logging.h"
9 #if defined(USE_OPENSSL)
10 #include <openssl/obj.h>
15 bool SignaturePolicy::IsAcceptableSignatureAlgorithm(
16 const SignatureAlgorithm
& algorithm
) const {
20 bool SignaturePolicy::IsAcceptableCurveForEcdsa(int curve_nid
) const {
21 #if defined(USE_OPENSSL)
23 case NID_X9_62_prime256v1
:
32 bool SignaturePolicy::IsAcceptableModulusLengthForRsa(
33 size_t modulus_length_bits
) const {
34 return modulus_length_bits
>= 2048;
37 SimpleSignaturePolicy::SimpleSignaturePolicy(size_t min_rsa_modulus_length_bits
)
38 : min_rsa_modulus_length_bits_(min_rsa_modulus_length_bits
) {}
40 bool SimpleSignaturePolicy::IsAcceptableModulusLengthForRsa(
41 size_t modulus_length_bits
) const {
42 return modulus_length_bits
>= min_rsa_modulus_length_bits_
;