Use this API to sign dnszone resources.
186004
public static base_responses sign(nitro_service client, dnszone resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dnszone signresources[] = new dnszone[resources.length];
			for (int i=0;i<resources.length;i++){
				signresources[i] = new dnszone();
				signresources[i].zonename = resources[i].zonename;
				signresources[i].keyname = resources[i].keyname;
			}
			result = perform_operation_bulk_request(client, signresources,"sign");
		}
		return result;
	}
551348
@Override
    public void sign ( byte[] data, int offset, int length, CommonServerMessageBlock request, CommonServerMessageBlock response ) {
        if ( log.isTraceEnabled() ) {
            log.trace("Signing with seq " + this.signSequence);
        }

        ( (ServerMessageBlock) request ).setSignSeq(this.signSequence);
        if ( response != null ) {
            ( (ServerMessageBlock) response ).setSignSeq(this.signSequence + 1);
        }

        try {
            update(this.macSigningKey, 0, this.macSigningKey.length);
            int index = offset + SmbConstants.SIGNATURE_OFFSET;
            for ( int i = 0; i < 8; i++ )
                data[ index + i ] = 0;
            SMBUtil.writeInt4(this.signSequence, data, index);
            update(data, offset, length);
            System.arraycopy(digest(), 0, data, index, 8);
            if ( this.bypass ) {
                this.bypass = false;
                System.arraycopy("BSRSPYL ".getBytes(), 0, data, index, 8);
            }
        }
        catch ( Exception ex ) {
            log.error("Signature failed", ex);
        }
        finally {
            if ( request instanceof SmbComNtCancel ) {
                this.signSequence++;
            }
            else {
                this.signSequence += 2;
            }
        }
    }
428419
@SneakyThrows
    protected SignatureSigningParameters buildSignatureSigningParameters(final RoleDescriptor descriptor,
                                                                         final SamlRegisteredService service) {
        val criteria = new CriteriaSet();
        val signatureSigningConfiguration = getSignatureSigningConfiguration(descriptor, service);
        criteria.add(new SignatureSigningConfigurationCriterion(signatureSigningConfiguration));
        criteria.add(new RoleDescriptorCriterion(descriptor));
        val resolver = new SAMLMetadataSignatureSigningParametersResolver();
        LOGGER.trace("Resolving signature signing parameters for [{}]", descriptor.getElementQName().getLocalPart());
        val params = resolver.resolveSingle(criteria);
        if (params != null) {
            LOGGER.trace("Created signature signing parameters."
                            + "\nSignature algorithm: [{}]"
                            + "\nSignature canonicalization algorithm: [{}]"
                            + "\nSignature reference digest methods: [{}]",
                    params.getSignatureAlgorithm(),
                    params.getSignatureCanonicalizationAlgorithm(),
                    params.getSignatureReferenceDigestMethod());
        } else {
            LOGGER.warn("Unable to resolve SignatureSigningParameters, response signing will fail."
                    + " Make sure domain names in IDP metadata URLs and certificates match CAS domain name");
        }
        return params;
    }
1206624
public static base_response add(nitro_service client, dnszone resource) throws Exception {
		dnszone addresource = new dnszone();
		addresource.zonename = resource.zonename;
		addresource.proxymode = resource.proxymode;
		addresource.dnssecoffload = resource.dnssecoffload;
		addresource.nsec = resource.nsec;
		return addresource.add_resource(client);
	}
860788
def sign(key, qs):
    """"""
    sig = derive_signature(key, qs)
    return "%s&%s" % (qs, urlencode([("sig", sig)]))
35732
public static dnszone[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
		dnszone obj = new dnszone();
		options option = new options();
		option.set_filter(filter);
		dnszone[] response = (dnszone[]) obj.getfiltered(service, option);
		return response;
	}
45492
public static dnszone get(nitro_service service, String zonename) throws Exception{
		dnszone obj = new dnszone();
		obj.set_zonename(zonename);
		dnszone response = (dnszone) obj.get_resource(service);
		return response;
	}
1364763
def _create_signing_params(self, url, keypair_id,
                          expire_time=None, valid_after_time=None,
                          ip_address=None, policy_url=None,
                          private_key_file=None, private_key_string=None):
        
        params = {}
        # Check if we can use a canned policy
        if expire_time and not valid_after_time and not ip_address and not policy_url:
            # we manually construct this policy string to ensure formatting
            # matches signature
            policy = self._canned_policy(url, expire_time)
            params["Expires"] = str(expire_time)
        else:
            # If no policy_url is specified, default to the full url.
            if policy_url is None:
                policy_url = url
            # Can't use canned policy
            policy = self._custom_policy(policy_url, expires=expire_time,
                                         valid_after=valid_after_time,
                                         ip_address=ip_address)

            encoded_policy = self._url_base64_encode(policy)
            params["Policy"] = encoded_policy
        #sign the policy
        signature = self._sign_string(policy, private_key_file, private_key_string)
        #now base64 encode the signature (URL safe as well)
        encoded_signature = self._url_base64_encode(signature)
        params["Signature"] = encoded_signature
        params["Key-Pair-Id"] = keypair_id
        return params
1159059
public static dnszone[] get(nitro_service service) throws Exception{
		dnszone obj = new dnszone();
		dnszone[] response = (dnszone[])obj.get_resources(service);
		return response;
	}
886832
public static SignatureValidationFilter buildSignatureValidationFilter(final String signatureResourceLocation) throws Exception {
        val resource = ResourceUtils.getResourceFrom(signatureResourceLocation);
        return buildSignatureValidationFilter(resource);
    }
834226
def sign_certificate():
    
    LOGGER.info("Signing certificate...")
    cmd = [
        'openssl', 'req',
        '-in', os.path.join(gettempdir(), 'domain.csr'),
        '-outform', 'DER'
    ]
    devnull = open(os.devnull, 'wb')
    csr_der = subprocess.check_output(cmd, stderr=devnull)
    code, result = _send_signed_request(DEFAULT_CA + "/acme/new-cert", {
        "resource": "new-cert",
        "csr": _b64(csr_der),
    })
    if code != 201:
        raise ValueError("Error signing certificate: {0} {1}".format(code, result))
    LOGGER.info("Certificate signed!")

    return result
1323313
def sign(message, **config):
    

    if not _implementation:
        init(**config)

    return _implementation.sign(message, **config)
409105
def sign(hash_, print_all_hashes, show, apk):
    """"""
    androsign_main(apk, hash_, print_all_hashes, show)
1133578
def setup_signing(self, secret_key, sign_outgoing=True, allow_unsigned_callback=None, initial_timestamp=None, link_id=None):
        ''''''
        self.mav.signing.secret_key = secret_key
        self.mav.signing.sign_outgoing = sign_outgoing
        self.mav.signing.allow_unsigned_callback = allow_unsigned_callback
        if link_id is None:
            # auto-increment the link_id for each link
            global global_link_id
            link_id = global_link_id
            global_link_id = min(global_link_id + 1, 255)
        self.mav.signing.link_id = link_id
        if initial_timestamp is None:
            # timestamp is time since 1/1/2015
            epoch_offset = 1420070400
            now = max(time.time(), epoch_offset)
            initial_timestamp = now - epoch_offset
            initial_timestamp = int(initial_timestamp * 100 * 1000)
        # initial_timestamp is in 10usec units
        self.mav.signing.timestamp = initial_timestamp
646739
def register(self):
        
        os.environ[self.resourceEnvNamePrefix + self.pathHash] = self.pickle()
1264659
public static base_response add(nitro_service client, dnsaction resource) throws Exception {
		dnsaction addresource = new dnsaction();
		addresource.actionname = resource.actionname;
		addresource.actiontype = resource.actiontype;
		addresource.ipaddress = resource.ipaddress;
		addresource.ttl = resource.ttl;
		addresource.viewname = resource.viewname;
		addresource.preferredloclist = resource.preferredloclist;
		return addresource.add_resource(client);
	}
473364
@Override
    public void sign(SignableRequest<?> request, AWSCredentials credentials) throws SdkClientException {
        // annonymous credentials, don't sign
        if ( credentials instanceof AnonymousAWSCredentials ) {
            return;
        }

        AWSCredentials sanitizedCredentials = sanitizeCredentials(credentials);

        SigningAlgorithm algorithm = SigningAlgorithm.HmacSHA256;
        String nonce = UUID.randomUUID().toString();

        int timeOffset = request.getTimeOffset();
        Date dateValue = getSignatureDate(timeOffset);
        String date = DateUtils.formatRFC822Date(dateValue);
        boolean isHttps = false;

        if (overriddenDate != null) date = overriddenDate;
        request.addHeader("Date", date);
        request.addHeader("X-Amz-Date", date);

        // AWS3 HTTP requires that we sign the Host header
        // so we have to have it in the request by the time we sign.
        String hostHeader = request.getEndpoint().getHost();
        if (SdkHttpUtils.isUsingNonDefaultPort(request.getEndpoint())) {
            hostHeader += ":" + request.getEndpoint().getPort();
        }
        request.addHeader("Host", hostHeader);

        if ( sanitizedCredentials instanceof AWSSessionCredentials ) {
            addSessionCredentials(request, (AWSSessionCredentials) sanitizedCredentials);
        }
        byte[] bytesToSign;
        String stringToSign;
        if (isHttps) {
            request.addHeader(NONCE_HEADER, nonce);
            stringToSign = date + nonce;
            bytesToSign = stringToSign.getBytes(UTF8);
        } else {
            String path = SdkHttpUtils.appendUri(request.getEndpoint().getPath(), request.getResourcePath());

            /*
             * AWS3 requires all query params to be listed on the third line of
             * the string to sign, even if those query params will be sent in
             * the request body and not as a query string. POST formatted query
             * params should *NOT* be included in the request payload.
             */
            stringToSign = request.getHttpMethod().toString() + "\n"
                    + getCanonicalizedResourcePath(path) + "\n"
                    + getCanonicalizedQueryString(request.getParameters()) + "\n"
                    + getCanonicalizedHeadersForStringToSign(request) + "\n"
                    + getRequestPayloadWithoutQueryParams(request);
            bytesToSign = hash(stringToSign);
        }
        if (log.isDebugEnabled())
            log.debug("Calculated StringToSign: " + stringToSign);

        String signature = signAndBase64Encode(bytesToSign,
                sanitizedCredentials.getAWSSecretKey(), algorithm);

        StringBuilder builder = new StringBuilder();
        builder.append(isHttps ? HTTPS_SCHEME : HTTP_SCHEME).append(" ");
        builder.append("AWSAccessKeyId=" + sanitizedCredentials.getAWSAccessKeyId() + ",");
        builder.append("Algorithm=" + algorithm.toString() + ",");

        if (!isHttps) {
            builder.append(getSignedHeadersComponent(request) + ",");
        }

        builder.append("Signature=" + signature);
        request.addHeader(AUTHORIZATION_HEADER, builder.toString());
    }