FileDocCategorySizeDatePackage
MediaDrmSigner.javaAPI DocAndroid 5.1 API4825Thu Mar 12 22:22:30 GMT 2015com.android.mediadrm.signer

MediaDrmSigner

public final class MediaDrmSigner extends Object
Provides certificate request generation, response handling and signing APIs

Fields Summary
public static final int
CERTIFICATE_TYPE_X509
Specify X.509 certificate type
Constructors Summary
private MediaDrmSigner()

Methods Summary
public static com.android.mediadrm.signer.MediaDrmSigner$CertificateRequestgetCertificateRequest(android.media.MediaDrm drm, int certType, java.lang.String certAuthority)
Generate a certificate request, specifying the certificate type and authority. The response received should be passed to provideCertificateResponse.

param
drm the MediaDrm object
param
certType Specifies the certificate type.
param
certAuthority is passed to the certificate server to specify the chain of authority.

        return new CertificateRequest(drm.getCertificateRequest(certType, certAuthority));
    
public static com.android.mediadrm.signer.MediaDrmSigner$CertificateprovideCertificateResponse(android.media.MediaDrm drm, byte[] response)
Process a response from the provisioning server. The response is obtained from an HTTP Post to the url provided by getCertificateRequest. The public X509 certificate chain and wrapped private key are returned in the returned Certificate objec. The certificate chain is in BIO serialized PEM format. The wrapped private key should be stored in application private storage, and used when invoking the signRSA method.

param
drm the MediaDrm object
param
response the opaque certificate response byte array to provide to the DRM engine plugin.
throws
android.media.DeniedByServerException if the response indicates that the server rejected the request

        return new Certificate(drm.provideCertificateResponse(response));
    
public static byte[]signRSA(android.media.MediaDrm drm, byte[] sessionId, java.lang.String algorithm, byte[] wrappedKey, byte[] message)
Sign data using an RSA key

param
drm the MediaDrm object
param
sessionId a sessionId obtained from openSession on the MediaDrm object
param
algorithm the signing algorithm to use, e.g. "PKCS1-BlockType1"
param
wrappedKey - the wrapped (encrypted) RSA private key obtained from provideCertificateResponse
param
message the data for which a signature is to be computed

        return drm.signRSA(sessionId, algorithm, wrappedKey, message);