PHP Class Wrep\Notificato\Apns\Certificate

Inheritance: implements Serializable
显示文件 Open project: wrep/notificato Class Usage Examples

Public Methods

Method Description
__construct ( $pemFile, $passphrase = null, $validate = true, $endpointEnv = null ) APNS Certificate constructor
getDescription ( ) : string An as humanreadable as possible description of the certificate to identify the certificate
getEndpoint ( $endpointType ) : string Get the endpoint this certificate is valid for
getEnvironment ( ) : Certificate::ENDPOINT_ENV_PRODUCTION | Certificate::ENDPOINT_ENV_SANDBOX Get the APNS environment this certificate is associated with
getFingerprint ( ) : string Get a unique hash of the certificate this can be used to check if two Apns\Certificate objects are the same
getPassphrase ( ) : string Passphrase to use with the PEM file
getPemFile ( ) : string Get the path to the PEM file
getValidFrom ( ) : DateTime | null Get moment this certificate will become valid Note: Will return null if certificate validation was disabled
getValidTo ( ) : DateTime | null Get moment this certificate will expire Note: Will return null if certificate validation was disabled
hasPassphrase ( ) : boolean Checks if there is a passphrase to use with the certificate
isValidated ( ) : boolean Check if this certificate is validated
serialize ( ) : string String representation of object
unserialize ( $serialized ) Constructs the object from serialized data

Private Methods

Method Description
parseCertificate ( ) Parse and validate the certificate and private key, also extracts usefull data and sets it on this object Also throws exceptions if the certificate/private key doesn't seem to be a valid APNS cert

Method Details

__construct() public method

APNS Certificate constructor
public __construct ( $pemFile, $passphrase = null, $validate = true, $endpointEnv = null )

getDescription() public method

An as humanreadable as possible description of the certificate to identify the certificate
public getDescription ( ) : string
return string

getEndpoint() public method

Get the endpoint this certificate is valid for
public getEndpoint ( $endpointType ) : string
return string

getEnvironment() public method

Get the APNS environment this certificate is associated with
public getEnvironment ( ) : Certificate::ENDPOINT_ENV_PRODUCTION | Certificate::ENDPOINT_ENV_SANDBOX
return Certificate::ENDPOINT_ENV_PRODUCTION | Certificate::ENDPOINT_ENV_SANDBOX

getFingerprint() public method

Get a unique hash of the certificate this can be used to check if two Apns\Certificate objects are the same
public getFingerprint ( ) : string
return string

getPassphrase() public method

Passphrase to use with the PEM file
public getPassphrase ( ) : string
return string

getPemFile() public method

Get the path to the PEM file
public getPemFile ( ) : string
return string

getValidFrom() public method

Get moment this certificate will become valid Note: Will return null if certificate validation was disabled
public getValidFrom ( ) : DateTime | null
return DateTime | null

getValidTo() public method

Get moment this certificate will expire Note: Will return null if certificate validation was disabled
public getValidTo ( ) : DateTime | null
return DateTime | null

hasPassphrase() public method

Checks if there is a passphrase to use with the certificate
public hasPassphrase ( ) : boolean
return boolean

isValidated() public method

Check if this certificate is validated
public isValidated ( ) : boolean
return boolean

serialize() public method

String representation of object
public serialize ( ) : string
return string

unserialize() public method

Constructs the object from serialized data
public unserialize ( $serialized )