public final class MediaDrmSigner extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MediaDrmSigner.Certificate
Contains the wrapped private key and public certificate data associated
with a certificate.
|
static class |
MediaDrmSigner.CertificateRequest
Contains the opaque data an app uses to request a certificate from a provisioning
server
|
Modifier and Type | Field and Description |
---|---|
static int |
CERTIFICATE_TYPE_X509
Specify X.509 certificate type
|
Modifier and Type | Method and Description |
---|---|
static MediaDrmSigner.CertificateRequest |
getCertificateRequest(MediaDrm drm,
int certType,
String certAuthority)
Generate a certificate request, specifying the certificate type
and authority.
|
static MediaDrmSigner.Certificate |
provideCertificateResponse(MediaDrm drm,
byte[] response)
Process a response from the provisioning server.
|
static byte[] |
signRSA(MediaDrm drm,
byte[] sessionId,
String algorithm,
byte[] wrappedKey,
byte[] message)
Sign data using an RSA key
|
public static final int CERTIFICATE_TYPE_X509
public static MediaDrmSigner.CertificateRequest getCertificateRequest(MediaDrm drm, int certType, String certAuthority)
drm
- the MediaDrm objectcertType
- Specifies the certificate type.certAuthority
- is passed to the certificate server to specify
the chain of authority.public static MediaDrmSigner.Certificate provideCertificateResponse(MediaDrm drm, byte[] response) throws DeniedByServerException
drm
- the MediaDrm objectresponse
- the opaque certificate response byte array to provide to the
DRM engine plugin.DeniedByServerException
- if the response indicates that the
server rejected the requestpublic static byte[] signRSA(MediaDrm drm, byte[] sessionId, String algorithm, byte[] wrappedKey, byte[] message)
drm
- the MediaDrm objectsessionId
- a sessionId obtained from openSession on the MediaDrm objectalgorithm
- the signing algorithm to use, e.g. "PKCS1-BlockType1"wrappedKey
- - the wrapped (encrypted) RSA private key obtained
from provideCertificateResponsemessage
- the data for which a signature is to be computed