2
0

basic-constraints.js 796 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright 2018 Scytl Secure Electronic Voting SA
  3. *
  4. * All rights reserved
  5. *
  6. * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
  7. */
  8. /* jshint node:true */
  9. 'use strict';
  10. module.exports = BasicConstraints;
  11. /**
  12. * @class BasicConstraints
  13. * @classdesc Encapsulates the basic constraints of an X.509 certificate. This
  14. * object is instantiated internally by the method
  15. * {@link CertificateService.newX509Certificate} and made available
  16. * as a property of the returned {@link X509Certificate} object.
  17. * @property {boolean} ca <code>true</code> if the CA flag is set,
  18. * <code>false</code> otherwise.
  19. */
  20. function BasicConstraints(constraints) {
  21. return Object.freeze({ca: constraints.cA});
  22. }