Register an requestSigner
@param requestSigner
an instance of an RequestSigner to use for a given type
@param signerType
the type of requestSigner that this instance will be used for
184342
public RequestSignerRegistry register(RequestSigner requestSigner, Class<? extends RequestSigner> signerType) {
        Map<Class<? extends RequestSigner>, RequestSigner> registeredSigners = new HashMap<>();
        registeredSigners.putAll(signerForType);
        registeredSigners.put(signerType, requestSigner);
        return new RequestSignerRegistry(registeredSigners);
    }
814688
def _sign(self, signer: Signer) -> Signature:
        
        # Important: we don't write the signature to `.signature`
        data = self._data_to_sign()
        return signer.sign(data)
135699
public <R, W> JSONer register(Converter<R, W> converter, Class<?>... types) {
        for (Class<?> type : checkNotNull(types)) {
            typeConverts.put(type, checkNotNull(converter));
        }
        return this;
    }
1366093
public void register(FoxHttpInterceptorType interceptorType, FoxHttpInterceptor foxHttpInterceptor) throws FoxHttpException {
        FoxHttpInterceptorType.verifyInterceptor(interceptorType, foxHttpInterceptor);
        if (foxHttpInterceptors.containsKey(interceptorType)) {
            foxHttpInterceptors.get(interceptorType).add(foxHttpInterceptor);
        } else {
            foxHttpInterceptors.put(interceptorType, new ArrayList<>(Arrays.asList(foxHttpInterceptor)));
        }
    }
58183
private void addPreSignInformationToRequest(SignableRequest<?> request,
            AWSCredentials credentials, AWS4SignerRequestParams signerParams,
            String timeStamp, long expirationInSeconds) {

        String signingCredentials = credentials.getAWSAccessKeyId() + "/"
                + signerParams.getScope();

        request.addParameter(X_AMZ_ALGORITHM, AWS4_SIGNING_ALGORITHM);
        request.addParameter(X_AMZ_DATE, timeStamp);
        request.addParameter(X_AMZ_SIGNED_HEADER,
                getSignedHeadersString(request));
        request.addParameter(X_AMZ_EXPIRES,
                Long.toString(expirationInSeconds));
        request.addParameter(X_AMZ_CREDENTIAL, signingCredentials);
    }
1022716
public static void register(FilterCriteriaType type) {
        if (REGISTRY.containsKey(type.getName()))
            throw new IllegalStateException(
                    String.format("FilterCriteriaType with name %s is already registered!", type.getName()));
        REGISTRY.put(type.getName(), type);
    }
277074
@FFDCIgnore(Exception.class)
    protected void initSigningKey(BuilderImpl jwtBuilder, JwtConfig jwtConfig) throws JwtTokenException {
        String keyType = Constants.SIGNING_KEY_X509;
        try {
            if (jwtConfig.isJwkEnabled() && SIGNATURE_ALG_RS256.equals(signatureAlgorithm)) {
                keyType = Constants.SIGNING_KEY_JWK;
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "Signing key type is " + keyType);
                }
                JSONWebKey jwk = jwtConfig.getJSONWebKey();
                if (jwk == null) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "Did not succcessfully build a JWK");
                    }
                    _signingKey = null;
                    _keyId = null;
                } else {
                    _signingKey = jwk.getPrivateKey();
                    _keyId = jwk.getKeyID();
                }
            } else {
                if (SIGNATURE_ALG_HS256.equals(signatureAlgorithm)) {
                    keyType = Constants.SIGNING_KEY_SECRET;
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "Signing key type is " + keyType);
                    }
                    String sharedKey = jwtBuilder.getSharedKey();
                    if (JwtUtils.isNullEmpty(sharedKey)) {
                        sharedKey = jwtConfig.getSharedKey();
                    }
                    if (!JwtUtils.isNullEmpty(sharedKey)) {
                        _signingKey = new HmacKey(sharedKey.getBytes("UTF-8"));
                    } else {
                        _signingKey = null;
                    }

                } else if (SIGNATURE_ALG_RS256.equals(signatureAlgorithm)) {
                    _signingKey = jwtBuilder.getKey();
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "Signing key type is " + keyType);
                    }
                    if (_signingKey == null) {
                        String keyAlias = null;
                        String keyStoreRef = null;
                        keyAlias = jwtConfig.getKeyAlias();
                        keyStoreRef = jwtConfig.getKeyStoreRef();
                        _signingKey = JwtUtils.getPrivateKey(keyAlias, keyStoreRef);
                        _keyId = buildKidFromPublicKey(JwtUtils.getPublicKey(keyAlias, keyStoreRef));
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Key alias: " + keyAlias + ", Keystore: " + keyStoreRef+ ", kid: " + _keyId);
                        }
                    }

                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "RSAPrivateKey: " + (_signingKey instanceof RSAPrivateKey));
                    }
                    if (_signingKey != null && !(_signingKey instanceof RSAPrivateKey)) {
                        // error handling
                        // String errorMsg = Tr.formatMessage(tc, "SIGNING_KEY_NOT_RSA", new Object[] { signatureAlgorithm });
                        // Object[] objs = new Object[] { signatureAlgorithm, errorMsg };
                        // noKeyException = JWTTokenException.newInstance(false, "JWT_BAD_SIGNING_KEY", objs);
                        _signingKey = null; // we will catch this later in jwtSigner
                        _keyId = null;
                    }
                }
            }
        } catch (Exception e) {
            // UnsupportedEncodingException e (won't happen)
            // if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            // Tr.debug(tc, "Exception obtaining the signing key: " + e);
            // }
            // error messages
            // JWT_BAD_SIGNING_KEY=CWWKS1455E: A signing key was not available. The signature algorithm is [{0}]. {1}

            Object[] objs = new Object[] { signatureAlgorithm, jwtConfig.isJwkEnabled(), e.getLocalizedMessage() }; // let JWTTokenException handle the exception
            JwtTokenException jte = JwtTokenException.newInstance(false, "JWT_NO_SIGNING_KEY_WITH_ERROR", objs);
            jte.initCause(e);
            throw jte;
        }
        if (_signingKey == null) {
            Object[] objs = new Object[] { signatureAlgorithm, jwtConfig.isJwkEnabled(), "" }; // let JWTTokenException handle the exception
            throw JwtTokenException.newInstance(true, "JWT_NO_SIGNING_KEY_WITH_ERROR", objs);
        }
    }
34525
public function setSignerType(\AgentSIB\Diadoc\Api\Proto\Invoicing\Signers\SignerType $value)
    {
        $this->SignerType = $value;
    }
112635
public void registerAsType(Object locator, Class<?> type) {
		if (locator == null)
			throw new NullPointerException("Locator cannot be null");
		if (type == null)
			throw new NullPointerException("Type cannot be null");

		IComponentFactory factory = new DefaultComponentFactory(type);
		_registrations.add(new Registration(locator, factory));
	}
1033748
function MutationSigner(privateKey) {
    this.publicKey = ByteBuffer.wrap(privateKey.publicKey.toBuffer());
    this._signer = bitcore.crypto.ECDSA().set({
        endian: "big",
        privkey: privateKey.privateKey
    });
}
1087199
def register(self, request_class: Request, mapper_func: Callable[[Request], BrightsideMessage]) -> None:
        

        key = request_class.__name__
        if key not in self._registry:
            self._registry[key] = mapper_func
        else:
            raise ConfigurationException("There is already a message mapper defined for this key; there can be only one")
432239
def register(self, provider):
        ''''''
        if isinstance(provider,type):
            provider = provider()
        self[provider.code] = provider
162694
private static void fieldTypeSignature(Result sb, TypeMirror type) throws IOException
    {
        switch (type.getKind())
        {
            case DECLARED:
                classTypeSignature(sb, type);
                break;
            case TYPEVAR:
                typeVariableSignature(sb, (TypeVariable)type);
                break;
            case ARRAY:
                arrayTypeSignature(sb, (ArrayType)type);
                break;
            default:
                //throw new UnsupportedOperationException(type.getKind()+" unsupported");
        }
    }
1120338
public static base_response sign(nitro_service client, dnszone resource) throws Exception {
		dnszone signresource = new dnszone();
		signresource.zonename = resource.zonename;
		signresource.keyname = resource.keyname;
		return signresource.perform_operation(client,"sign");
	}
896914
public String getSignature(TypeMirror type) {
    StringBuilder sb = new StringBuilder();
    buildTypeSignature(type, sb);
    return sb.toString();
  }
668915
public void registerAuthenticationProvider(Class<? extends AuthenticationProvider> providerClass) {
    AuthenticationProvider provider = instantiateProvider(providerClass);
    authenticationProviders.put(provider.getName(), providerClass);  
    credentialAuths.put(provider.getName(), provider.requiresCredentials());
  }
501370
function(signer) {
      if('content' in msg) {
        throw new Error('PKCS#7 signing not yet implemented.');
      }

      if(typeof msg.content !== 'object') {
        // use Data ContentInfo
        msg.contentInfo = asn1.create(
          asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
            // ContentType
            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
              asn1.oidToDer(forge.pki.oids.data).getBytes())
          ]);

        // add actual content, if present
        if('content' in msg) {
          msg.contentInfo.value.push(
            // [0] EXPLICIT content
            asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
              asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
                msg.content)
            ]));
        }
      }

      // TODO: generate digest algorithm identifiers

      // TODO: generate signerInfos
    }