Map a set of SignerInfo ASN.1 objects to an array of signer objects.

@param signerInfoAsn1s an array of ASN.1 SignerInfos (i.e. SET OF).

@return an array of signers objects.
480569
function _signersFromAsn1(signerInfoAsn1s) {
  var ret = [];
  for(var i = 0; i < signerInfoAsn1s.length; ++i) {
    ret.push(_signerFromAsn1(signerInfoAsn1s[i]));
  }
  return ret;
}
1105786
@Override
    public DERObject toASN1Object()
    {
        ASN1EncodableVector v = new ASN1EncodableVector();

        v.add(issuer);
        v.add(serial);

        if (issuerUID != null)
        {
            v.add(issuerUID);
        }

        return new DERSequence(v);
    }
1216312
def get_inline_signers(signers, sequence)
      signers_array = []
      signers.each do |signer|
        signers_hash = {
          email: signer[:email],
          name: signer[:name],
          recipientId: signer[:recipient_id],
          roleName: signer[:role_name],
          clientUserId: signer[:client_id] || signer[:email],
          requireSignOnPaper: signer[:require_sign_on_paper] || false,
          tabs: {
            textTabs:       get_signer_tabs(signer[:text_tabs]),
            radioGroupTabs: get_radio_signer_tabs(signer[:radio_group_tabs]),
            checkboxTabs:   get_signer_tabs(signer[:checkbox_tabs]),
            numberTabs:     get_signer_tabs(signer[:number_tabs]),
            fullNameTabs:   get_signer_tabs(signer[:fullname_tabs]),
            dateTabs:       get_signer_tabs(signer[:date_tabs]),
            signHereTabs:   get_sign_here_tabs(signer[:sign_here_tabs])
          }
        }
        signers_array << signers_hash
      end
      template_hash = {sequence: sequence, recipients: { signers: signers_array }}
      [template_hash]
    end
395246
public static boolean compareSignatures(String plainSignature, String genericSignature) {
        GenericSignatureParser plainParser = new GenericSignatureParser(plainSignature);
        GenericSignatureParser genericParser = new GenericSignatureParser(genericSignature);

        return plainParser.getNumParameters() == genericParser.getNumParameters();
    }
751369
public static TypeSignature ofMap(TypeSignature keyTypeSignature, TypeSignature valueTypeSignature) {
        requireNonNull(keyTypeSignature, "keyTypeSignature");
        requireNonNull(valueTypeSignature, "valueTypeSignature");
        return ofContainer("map", keyTypeSignature, valueTypeSignature);
    }
1046785
public static X500Principal[] getIssuerDNsFromChain(List<X509Certificate> chain)
	{
		if (chain == null || chain.isEmpty())
			throw new IllegalArgumentException("Must provide a chain that is non-null and non-empty");

		// Given a chain of n, there are n-1 values for "issuers" and 1 "subject"
		final X500Principal[] issuers = new X500Principal[chain.size() - 1]; // Allocate array of n-1 for issuers

		for (int i = 0; i < issuers.length; i++)
		{
			final X509Certificate certificate = chain.get(i);
			final X500Principal subject = certificate.getSubjectX500Principal();

			issuers[i] = subject;
		}

		return issuers;
	}
843153
@JsonIgnore
	public Map<String, String> getCredentials() {
		if (getId() == null) {
			return Collections.emptyMap();
		} else {
			Map<String, String> keys = new LinkedHashMap<String, String>(2);
			keys.put("accessKey", getId());
			keys.put("secretKey", getSecret());
			return keys;
		}
	}
1063506
function( keys ) {
		var lookupString = keys.toString();
		var id = this.plainObjectSignatureLookup[lookupString];			
		if (id === undefined) {

			// Create new signature buffer
			var sigbuf = [];
			sigbuf.push( pack2b( keys.length, false ) );
			for (var i=0, l=keys.length; i<l; ++i) {
				sigbuf.push( pack2b( this.stringID(keys[i]), false ) );
			}

			// Keep on table
			this.plainObjectSignatureTable.push( Buffer.concat( sigbuf ) );
			this.plainObjectSignatureLookup[lookupString] 
				= id = this.plainObjectSignatureTable.length - 1;

		}
		return id;
	}
879778
private static Signer createSigner(String signerType) {
        Class<? extends Signer> signerClass = SIGNERS.get(signerType);
        Signer signer;
        try {
            signer = signerClass.newInstance();
        } catch (InstantiationException ex) {
            throw new IllegalStateException(
                    "Cannot create an instance of " + signerClass.getName(),
                    ex);
        } catch (IllegalAccessException ex) {
            throw new IllegalStateException(
                    "Cannot create an instance of " + signerClass.getName(),
                    ex);
        }
        return signer;
    }
492229
private final byte[] deriveSigningKey(AWSCredentials credentials,
            AWS4SignerRequestParams signerRequestParams) {

        final String cacheKey = computeSigningCacheKeyName(credentials,
                signerRequestParams);
        final long daysSinceEpochSigningDate = DateUtils
                .numberOfDaysSinceEpoch(signerRequestParams
                        .getSigningDateTimeMilli());

        SignerKey signerKey = signerCache.get(cacheKey);

        if (signerKey != null) {
            if (daysSinceEpochSigningDate == signerKey
                    .getNumberOfDaysSinceEpoch()) {
                return signerKey.getSigningKey();
            }
        }
        if (log.isDebugEnabled()) {
            log.debug("Generating a new signing key as the signing key not available in the cache for the date "
                    + TimeUnit.DAYS.toMillis(daysSinceEpochSigningDate));
        }
        byte[] signingKey = newSigningKey(credentials,
                signerRequestParams.getFormattedSigningDate(),
                signerRequestParams.getRegionName(),
                signerRequestParams.getServiceName());
        signerCache.add(cacheKey, new SignerKey(
                daysSinceEpochSigningDate, signingKey));
        return signingKey;
    }
129071
private static java.security.cert.Certificate[] mapSignersToCertArray(
        CodeSigner[] signers) {

        if (signers != null) {
            ArrayList certChains = new ArrayList();
            for (int i = 0; i < signers.length; i++) {
                certChains.addAll(
                    signers[i].getSignerCertPath().getCertificates());
            }

            // Convert into a Certificate[]
            return (java.security.cert.Certificate[])
                certChains.toArray(
                    new java.security.cert.Certificate[certChains.size()]);
        }
        return null;
    }
1143597
public List<KSISignature> sign() throws KSIException {
        TreeNode rootNode = treeBuilder.build();
        logger.debug("Root node calculated. {}(level={})", new DataHash(rootNode.getValue()), rootNode.getLevel());
        KSISignature rootNodeSignature = signRootNode(rootNode);
        if (leafs.size() == 1 && !leafs.get(0).hasMetadata()) {
            return Collections.singletonList(rootNodeSignature);
        }
        List<KSISignature> signatures = new LinkedList<>();
        AggregationHashChainBuilder chainBuilder = new AggregationHashChainBuilder();
        for (ImprintNode leaf : leafs) {
            signatures.add(signatureFactory.createSignature(rootNodeSignature, chainBuilder.build(leaf), new DataHash(leaf.getValue())));
        }
        return signatures;
    }
769076
public DERObject toASN1Object()
    {
        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(new DERInteger(getModulus()));
        v.add(new DERInteger(getPublicExponent()));

        return new DERSequence(v);
    }
1260928
public Map<String, String> build(SignType signType) throws Exception {
		Map<String, String> map = createMap();
		if(SignType.MD5 == signType) {
			map.put("sign_type", "MD5");
		}else {
			map.put("sign_type", "HMAC-SHA256");
		}
		map.put("sign", PaymentKit.createSign(map, getPaternerKey(), signType));
		return map;
	}
265967
@Override
  public List<NameAssignment> lookup(final Iterable<Identifier> identifiers) {
    LOG.log(Level.FINE, "identifiers");
    final List<NameAssignment> nas = new ArrayList<>();
    for (final Identifier id : identifiers) {
      final InetSocketAddress addr = idToAddrMap.get(id);
      LOG.log(Level.FINEST, "id : {0} addr: {1}", new Object[]{id, addr});
      if (addr != null) {
        nas.add(new NameAssignmentTuple(id, addr));
      }
    }
    return nas;
  }
920319
public Map<String, Serializable> getPostFields() throws HelloSignException {
        Map<String, Serializable> fields = super.getPostFields();
        try {
            if (hasTitle()) {
                fields.put(REQUEST_TITLE, getTitle());
            }
            if (hasSubject()) {
                fields.put(REQUEST_SUBJECT, getSubject());
            }
            if (hasMessage()) {
                fields.put(REQUEST_MESSAGE, getMessage());
            }
            List<Signer> signerz = getSigners();
            for (int i = 0; i < signerz.size(); i++) {
                Signer s = signerz.get(i);
                fields.put(SIGREQ_SIGNERS + "[" + i + "][" + SIGREQ_SIGNER_EMAIL + "]", s.getEmail());
                fields.put(SIGREQ_SIGNERS + "[" + i + "][" + SIGREQ_SIGNER_NAME + "]", s.getNameOrRole());
                if (getOrderMatters()) {
                    fields.put(SIGREQ_SIGNERS + "[" + i + "][" + SIGREQ_SIGNER_ORDER + "]", i);
                }
                if (s.getAccessCode() != null) {
                    fields.put(SIGREQ_SIGNERS + "[" + i + "][" + SIGREQ_SIGNER_PIN + "]", s.getAccessCode());
                }
            }
            List<String> ccz = getCCs();
            for (int i = 0; i < ccz.size(); i++) {
                String cc = ccz.get(i);
                fields.put(SIGREQ_CCS + "[" + i + "]", cc);
            }
            JSONArray reqFormFields = new JSONArray(); // Main array for the
                                                       // request
            boolean hasFormFields = false;
            List<Document> docs = getDocuments();
            for (int i = 0; i < docs.size(); i++) {
                Document d = docs.get(i);
                fields.put(SIGREQ_FILES + "[" + i + "]", d.getFile());
                JSONArray docFormFields = new JSONArray();
                for (FormField ff : d.getFormFields()) {
                    hasFormFields = true;
                    docFormFields.put(ff.getJSONObject());
                }
                reqFormFields.put(docFormFields);
            }
            List<String> fileUrls = getFileUrls();
            for (int i = 0; i < fileUrls.size(); i++) {
                fields.put("file_url[" + i + "]", fileUrls.get(i));
            }
            if (hasFormFields) {
                fields.put(SIGREQ_FORM_FIELDS, reqFormFields.toString());
            }
            if (isTestMode()) {
                fields.put(REQUEST_TEST_MODE, true);
            }
            if (hasRedirectUrl()) {
                fields.put(REQUEST_REDIRECT_URL, getRedirectUrl());
            }
            if (hasUseTextTags()) {
                fields.put(REQUEST_USE_TEXT_TAGS, isUsingTextTags());
            }
            if (hasHideTextTags()) {
                fields.put(REQUEST_HIDE_TEXT_TAGS, isHidingTextTags());
            }
        } catch (Exception ex) {
            throw new HelloSignException("Could not extract form fields from SignatureRequest.", ex);
        }
        return fields;
    }
1226356
private static Signer createSigner(String signerType,
            final String serviceName) {
        Class<? extends Signer> signerClass = SIGNERS.get(signerType);
        if (signerClass == null)
            throw new IllegalArgumentException("unknown signer type: " + signerType);
        Signer signer = createSigner(signerType);

        if (signer instanceof ServiceAwareSigner) {
            ((ServiceAwareSigner) signer).setServiceName(serviceName);
        }
        return signer;
    }