web_modules/forge.bundle.js
function(oid, obj, fillDefaults) {
  var params = {};

  if(oid !== oids['RSASSA-PSS']) {
    return params;
  }

  if(fillDefaults) {
    params = {
      hash: {
        algorithmOid: oids['sha1']
      },
      mgf: {
        algorithmOid: oids['mgf1'],
        hash: {
          algorithmOid: oids['sha1']
        }
      },
      saltLength: 20
    };
  }

  var capture = {};
  var errors = [];
  if(!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) {
    var error = new Error('Cannot read RSASSA-PSS parameter block.');
    error.errors = errors;
    throw error;
  }

  if(capture.hashOid !== undefined) {
    params.hash = params.hash || {};
    params.hash.algorithmOid = asn1.derToOid(capture.hashOid);
  }

  if(capture.maskGenOid !== undefined) {
    params.mgf = params.mgf || {};
    params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid);
    params.mgf.hash = params.mgf.hash || {};
    params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid);
  }

  if(capture.saltLength !== undefined) {
    params.saltLength = capture.saltLength.charCodeAt(0);
  }

  return params;
}
function(oid, obj, fillDefaults) {
  var params = {};

  if(oid !== oids['RSASSA-PSS']) {
    return params;
  }

  if(fillDefaults) {
    params = {
      hash: {
        algorithmOid: oids['sha1']
      },
      mgf: {
        algorithmOid: oids['mgf1'],
        hash: {
          algorithmOid: oids['sha1']
        }
      },
      saltLength: 20
    };
  }

  var capture = {};
  var errors = [];
  if(!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) {
    var error = new Error('Cannot read RSASSA-PSS parameter block.');
    error.errors = errors;
    throw error;
  }

  if(capture.hashOid !== undefined) {
    params.hash = params.hash || {};
    params.hash.algorithmOid = asn1.derToOid(capture.hashOid);
  }

  if(capture.maskGenOid !== undefined) {
    params.mgf = params.mgf || {};
    params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid);
    params.mgf.hash = params.mgf.hash || {};
    params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid);
  }

  if(capture.saltLength !== undefined) {
    params.saltLength = capture.saltLength.charCodeAt(0);
  }

  return params;
}
function ( oid , obj , fillDefaults ) { var params = { } ; if ( oid !== oids [ 'RSASSA-PSS' ] ) { return params ; } if ( fillDefaults ) { params = { hash : { algorithmOid : oids [ 'sha1' ] } , mgf : { algorithmOid : oids [ 'mgf1' ] , hash : { algorithmOid : oids [ 'sha1' ] } } , saltLength : 20 } ; } var capture = { } ; var errors = [ ] ; if ( ! asn1 . validate ( obj , rsassaPssParameterValidator , capture , errors ) ) { var error = new Error ( 'Cannot read RSASSA-PSS parameter block.' ) ; error . errors = errors ; throw error ; } if ( capture . hashOid !== undefined ) { params . hash = params . hash || { } ; params . hash . algorithmOid = asn1 . derToOid ( capture . hashOid ) ; } if ( capture . maskGenOid !== undefined ) { params . mgf = params . mgf || { } ; params . mgf . algorithmOid = asn1 . derToOid ( capture . maskGenOid ) ; params . mgf . hash = params . mgf . hash || { } ; params . mgf . hash . algorithmOid = asn1 . derToOid ( capture . maskGenHashOid ) ; } if ( capture . saltLength !== undefined ) { params . saltLength = capture . saltLength . charCodeAt ( 0 ) ; } return params ; }
Converts signature parameters from ASN.1 structure.

Currently only RSASSA-PSS supported.  The PKCS#1 v1.5 signature scheme had
no parameters.

RSASSA-PSS-params  ::=  SEQUENCE  {
hashAlgorithm      [0] HashAlgorithm DEFAULT
sha1Identifier,
maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT
mgf1SHA1Identifier,
saltLength         [2] INTEGER DEFAULT 20,
trailerField       [3] INTEGER DEFAULT 1
}

HashAlgorithm  ::=  AlgorithmIdentifier

MaskGenAlgorithm  ::=  AlgorithmIdentifier

AlgorithmIdentifer ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}

@param oid The OID specifying the signature algorithm
@param obj The ASN.1 structure holding the parameters
@param fillDefaults Whether to use return default values where omitted
@return signature parameter object
Converts signature parameters from ASN . 1 structure .