|
2 | 2 | // 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
3 | 3 | // for complete details.
|
4 | 4 |
|
| 5 | +use cryptography_x509::certificate::Certificate; |
| 6 | +use cryptography_x509::extensions::{Extension, Extensions}; |
5 | 7 | use cryptography_x509::oid::{
|
6 | 8 | AUTHORITY_INFORMATION_ACCESS_OID, AUTHORITY_KEY_IDENTIFIER_OID, BASIC_CONSTRAINTS_OID,
|
7 | 9 | EXTENDED_KEY_USAGE_OID, KEY_USAGE_OID, NAME_CONSTRAINTS_OID, SUBJECT_ALTERNATIVE_NAME_OID,
|
8 | 10 | SUBJECT_KEY_IDENTIFIER_OID,
|
9 | 11 | };
|
10 |
| -use cryptography_x509::{ |
11 |
| - certificate::Certificate, |
12 |
| - extensions::{Extension, Extensions}, |
13 |
| -}; |
14 | 12 |
|
15 |
| -use crate::{ |
16 |
| - ops::CryptoOps, policy::Policy, ValidationError, ValidationErrorKind, ValidationResult, |
17 |
| -}; |
| 13 | +use crate::ops::CryptoOps; |
| 14 | +use crate::policy::Policy; |
| 15 | +use crate::{ValidationError, ValidationErrorKind, ValidationResult}; |
18 | 16 |
|
19 | 17 | pub(crate) struct ExtensionPolicy<B: CryptoOps> {
|
20 | 18 | pub(crate) authority_information_access: ExtensionValidator<B>,
|
@@ -266,17 +264,13 @@ impl<B: CryptoOps> ExtensionValidator<B> {
|
266 | 264 | }
|
267 | 265 |
|
268 | 266 | pub(crate) mod ee {
|
269 |
| - use cryptography_x509::{ |
270 |
| - certificate::Certificate, |
271 |
| - extensions::{ |
272 |
| - BasicConstraints, ExtendedKeyUsage, Extension, KeyUsage, SubjectAlternativeName, |
273 |
| - }, |
| 267 | + use cryptography_x509::certificate::Certificate; |
| 268 | + use cryptography_x509::extensions::{ |
| 269 | + BasicConstraints, ExtendedKeyUsage, Extension, KeyUsage, SubjectAlternativeName, |
274 | 270 | };
|
275 | 271 |
|
276 |
| - use crate::{ |
277 |
| - ops::CryptoOps, |
278 |
| - policy::{Policy, ValidationError, ValidationErrorKind, ValidationResult}, |
279 |
| - }; |
| 272 | + use crate::ops::CryptoOps; |
| 273 | + use crate::policy::{Policy, ValidationError, ValidationErrorKind, ValidationResult}; |
280 | 274 |
|
281 | 275 | pub(crate) fn basic_constraints<'chain, B: CryptoOps>(
|
282 | 276 | _policy: &Policy<'_, B>,
|
@@ -379,20 +373,16 @@ pub(crate) mod ee {
|
379 | 373 | }
|
380 | 374 |
|
381 | 375 | pub(crate) mod ca {
|
382 |
| - use cryptography_x509::{ |
383 |
| - certificate::Certificate, |
384 |
| - common::Asn1Read, |
385 |
| - extensions::{ |
386 |
| - AuthorityKeyIdentifier, BasicConstraints, ExtendedKeyUsage, Extension, KeyUsage, |
387 |
| - NameConstraints, |
388 |
| - }, |
389 |
| - oid::EKU_ANY_KEY_USAGE_OID, |
| 376 | + use cryptography_x509::certificate::Certificate; |
| 377 | + use cryptography_x509::common::Asn1Read; |
| 378 | + use cryptography_x509::extensions::{ |
| 379 | + AuthorityKeyIdentifier, BasicConstraints, ExtendedKeyUsage, Extension, KeyUsage, |
| 380 | + NameConstraints, |
390 | 381 | };
|
| 382 | + use cryptography_x509::oid::EKU_ANY_KEY_USAGE_OID; |
391 | 383 |
|
392 |
| - use crate::{ |
393 |
| - ops::CryptoOps, |
394 |
| - policy::{Policy, ValidationError, ValidationErrorKind, ValidationResult}, |
395 |
| - }; |
| 384 | + use crate::ops::CryptoOps; |
| 385 | + use crate::policy::{Policy, ValidationError, ValidationErrorKind, ValidationResult}; |
396 | 386 |
|
397 | 387 | pub(crate) fn authority_key_identifier<'chain, B: CryptoOps>(
|
398 | 388 | _policy: &Policy<'_, B>,
|
@@ -529,16 +519,12 @@ pub(crate) mod ca {
|
529 | 519 | }
|
530 | 520 |
|
531 | 521 | pub(crate) mod common {
|
532 |
| - use cryptography_x509::{ |
533 |
| - certificate::Certificate, |
534 |
| - common::Asn1Read, |
535 |
| - extensions::{Extension, SequenceOfAccessDescriptions}, |
536 |
| - }; |
| 522 | + use cryptography_x509::certificate::Certificate; |
| 523 | + use cryptography_x509::common::Asn1Read; |
| 524 | + use cryptography_x509::extensions::{Extension, SequenceOfAccessDescriptions}; |
537 | 525 |
|
538 |
| - use crate::{ |
539 |
| - ops::CryptoOps, |
540 |
| - policy::{Policy, ValidationResult}, |
541 |
| - }; |
| 526 | + use crate::ops::CryptoOps; |
| 527 | + use crate::policy::{Policy, ValidationResult}; |
542 | 528 |
|
543 | 529 | pub(crate) fn authority_information_access<'chain, B: CryptoOps>(
|
544 | 530 | _policy: &Policy<'_, B>,
|
|
0 commit comments