Reference documentation and code samples for the Cloud KMS V1 Client class KeyManagementServiceClient.
Service Description: Google Cloud Key Management Service
Manages cryptographic keys and operations using those keys. Implements a REST model with the following objects:
If you are using manual gRPC libraries, see Using gRPC with Cloud KMS .
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
This class is currently experimental and may be subject to changes. See Google\Cloud\Kms\V1\KeyManagementServiceClient for the stable implementation
Namespace
Google \ Cloud \ Kms \ V1 \ ClientMethods
__construct
Constructor.
options
array
Optional. Options for configuring the service API wrapper.
↳ apiEndpoint
string
The address of the API remote host. May optionally include the port, formatted as "
↳ credentials
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage : In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.
↳ credentialsConfig
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .
↳ disableRetries
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to false
.
↳ clientConfig
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.
↳ transport
string|TransportInterface
The transport used for executing network requests. May be either the string rest
or grpc
. Defaults to grpc
if gRPC support is detected on the system. Advanced usage
: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface
object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.
↳ transportConfig
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.
↳ clientCertSource
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.
asymmetricDecrypt
Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::asymmetricDecryptAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
asymmetricSign
Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::asymmetricSignAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
createCryptoKey
Create a new CryptoKey within a KeyRing .
CryptoKey.purpose and CryptoKey.version_template.algorithm are required.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::createCryptoKeyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
createCryptoKeyVersion
Create a new CryptoKeyVersion in a CryptoKey .
The server will assign the next sequential id. If unset, state will be set to ENABLED .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::createCryptoKeyVersionAsync() .
request
Google\Cloud\Kms\V1\CreateCryptoKeyVersionRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
createImportJob
Create a new ImportJob within a KeyRing .
ImportJob.import_method is required.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::createImportJobAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
createKeyRing
Create a new KeyRing in a given Project and Location.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::createKeyRingAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
decrypt
Decrypts data that was protected by Encrypt . The CryptoKey.purpose must be ENCRYPT_DECRYPT .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::decryptAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
destroyCryptoKeyVersion
Schedule a CryptoKeyVersion for destruction.
Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED , and destroy_time will be set to the time destroy_scheduled_duration in the future. At that time, the state will automatically change to DESTROYED , and the key material will be irrevocably destroyed.
Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::destroyCryptoKeyVersionAsync() .
request
Google\Cloud\Kms\V1\DestroyCryptoKeyVersionRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
encrypt
Encrypts data, so that it can only be recovered by a call to Decrypt . The CryptoKey.purpose must be ENCRYPT_DECRYPT .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::encryptAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
generateRandomBytes
Generate random bytes using the Cloud KMS randomness source in the provided location.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::generateRandomBytesAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getCryptoKey
Returns metadata for a given CryptoKey , as well as its primary CryptoKeyVersion .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::getCryptoKeyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getCryptoKeyVersion
Returns metadata for a given CryptoKeyVersion .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::getCryptoKeyVersionAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getImportJob
Returns metadata for a given ImportJob .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::getImportJobAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getKeyRing
Returns metadata for a given KeyRing .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::getKeyRingAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getPublicKey
Returns the public key for the given CryptoKeyVersion . The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::getPublicKeyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
importCryptoKeyVersion
Import wrapped key material into a CryptoKeyVersion .
All requests must specify a CryptoKey . If a CryptoKeyVersion is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::importCryptoKeyVersionAsync() .
request
Google\Cloud\Kms\V1\ImportCryptoKeyVersionRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listCryptoKeyVersions
Lists CryptoKeyVersions .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::listCryptoKeyVersionsAsync() .
request
Google\Cloud\Kms\V1\ListCryptoKeyVersionsRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listCryptoKeys
Lists CryptoKeys .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::listCryptoKeysAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listImportJobs
Lists ImportJobs .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::listImportJobsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listKeyRings
Lists KeyRings .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::listKeyRingsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
macSign
Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::macSignAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
macVerify
Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::macVerifyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
rawDecrypt
Decrypts data that was originally encrypted using a raw cryptographic mechanism. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::rawDecryptAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
rawEncrypt
Encrypts data using portable cryptographic primitives. Most users should choose Encrypt and Decrypt rather than their raw counterparts. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::rawEncryptAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
restoreCryptoKeyVersion
Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state.
Upon restoration of the CryptoKeyVersion, state will be set to DISABLED , and destroy_time will be cleared.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::restoreCryptoKeyVersionAsync() .
request
Google\Cloud\Kms\V1\RestoreCryptoKeyVersionRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
updateCryptoKey
Update a CryptoKey .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::updateCryptoKeyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
updateCryptoKeyPrimaryVersion
Update the version of a CryptoKey that will be used in Encrypt .
Returns an error if called on a key whose purpose is not ENCRYPT_DECRYPT .
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::updateCryptoKeyPrimaryVersionAsync() .
request
Google\Cloud\Kms\V1\UpdateCryptoKeyPrimaryVersionRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
updateCryptoKeyVersion
Update a CryptoKeyVersion 's metadata.
state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::updateCryptoKeyVersionAsync() .
request
Google\Cloud\Kms\V1\UpdateCryptoKeyVersionRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getLocation
Gets information about a location.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::getLocationAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listLocations
Lists information about the supported locations for this service.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::listLocationsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::getIamPolicyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
setIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND
, INVALID_ARGUMENT
, and PERMISSION_DENIED
errors.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::setIamPolicyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
testIamPermissions
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND
error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
The async variant is Google\Cloud\Kms\V1\Client\KeyManagementServiceClient::testIamPermissionsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
asymmetricDecryptAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
asymmetricSignAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
createCryptoKeyAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
createCryptoKeyVersionAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
createImportJobAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
createKeyRingAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
decryptAsync
GuzzleHttp\Promise\PromiseInterface
destroyCryptoKeyVersionAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
encryptAsync
GuzzleHttp\Promise\PromiseInterface
generateRandomBytesAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
getCryptoKeyAsync
GuzzleHttp\Promise\PromiseInterface
getCryptoKeyVersionAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
getImportJobAsync
GuzzleHttp\Promise\PromiseInterface
getKeyRingAsync
GuzzleHttp\Promise\PromiseInterface
getPublicKeyAsync
GuzzleHttp\Promise\PromiseInterface
importCryptoKeyVersionAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
listCryptoKeyVersionsAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
listCryptoKeysAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
listImportJobsAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
listKeyRingsAsync
GuzzleHttp\Promise\PromiseInterface
macSignAsync
GuzzleHttp\Promise\PromiseInterface
macVerifyAsync
GuzzleHttp\Promise\PromiseInterface
rawDecryptAsync
GuzzleHttp\Promise\PromiseInterface
rawEncryptAsync
GuzzleHttp\Promise\PromiseInterface
restoreCryptoKeyVersionAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
updateCryptoKeyAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
updateCryptoKeyPrimaryVersionAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
updateCryptoKeyVersionAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
getLocationAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
listLocationsAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
getIamPolicyAsync
GuzzleHttp\Promise\PromiseInterface
setIamPolicyAsync
GuzzleHttp\Promise\PromiseInterface
testIamPermissionsAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
static::cryptoKeyName
Formats a string containing the fully-qualified path to represent a crypto_key resource.
project
string
location
string
keyRing
string
cryptoKey
string
string
static::cryptoKeyVersionName
Formats a string containing the fully-qualified path to represent a crypto_key_version resource.
project
string
location
string
keyRing
string
cryptoKey
string
cryptoKeyVersion
string
string
static::importJobName
Formats a string containing the fully-qualified path to represent a import_job resource.
project
string
location
string
keyRing
string
importJob
string
string
static::keyRingName
Formats a string containing the fully-qualified path to represent a key_ring resource.
project
string
location
string
keyRing
string
string
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
project
string
location
string
string
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
- cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}
- importJob: projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}
- keyRing: projects/{project}/locations/{location}/keyRings/{key_ring}
- location: projects/{project}/locations/{location}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
formattedName
string
The formatted name string
template
string
Optional name of template to match
array