lib/providers/BaseProvider.php
protected function afterGenerateKeyPair(KeyPairInterface $keyPair)
    {
        if ($keyPair instanceof SecureKeyPairInterface) {
            $masterKeyPairProvider = $this->getMasterKeyPairProvider();
            $masterKeyName = $this->getMasterKeyName();
            if ($masterKeyPairProvider === null) {
                throw new InaccessibleKeyPairException('Provider has an invalid master key provider specified for its secure keys');
            }
            if (!$masterKeyPairProvider->has($masterKeyName)) {
                $masterKey = $masterKeyPairProvider->generate($masterKeyName);
            } else {
                $masterKey = $masterKeyPairProvider->get($masterKeyName);
            }
            $keyPair->lock($masterKey);
        }
        return $keyPair;
    }
protected function afterGenerateKeyPair(KeyPairInterface $keyPair)
    {
        if ($keyPair instanceof SecureKeyPairInterface) {
            $masterKeyPairProvider = $this->getMasterKeyPairProvider();
            $masterKeyName = $this->getMasterKeyName();
            if ($masterKeyPairProvider === null) {
                throw new InaccessibleKeyPairException('Provider has an invalid master key provider specified for its secure keys');
            }
            if (!$masterKeyPairProvider->has($masterKeyName)) {
                $masterKey = $masterKeyPairProvider->generate($masterKeyName);
            } else {
                $masterKey = $masterKeyPairProvider->get($masterKeyName);
            }
            $keyPair->lock($masterKey);
        }
        return $keyPair;
    }
protected function afterGenerateKeyPair ( KeyPairInterface $ keyPair ) { if ( $ keyPair instanceof SecureKeyPairInterface ) { $ masterKeyPairProvider = $ this -> getMasterKeyPairProvider ( ) ; $ masterKeyName = $ this -> getMasterKeyName ( ) ; if ( $ masterKeyPairProvider === null ) { throw new InaccessibleKeyPairException ( 'Provider has an invalid master key provider specified for its secure keys' ) ; } if ( ! $ masterKeyPairProvider -> has ( $ masterKeyName ) ) { $ masterKey = $ masterKeyPairProvider -> generate ( $ masterKeyName ) ; } else { $ masterKey = $ masterKeyPairProvider -> get ( $ masterKeyName ) ; } $ keyPair -> lock ( $ masterKey ) ; } return $ keyPair ; }
Process a key pair object after it was generated

@param  KeyPairInterface $keyPair Key pair object that was just generated
@return KeyPairInterface Original instance of the key pair
Process a key pair object after it was generated