public byte[] generateCertificateSignature(byte[] hash) throws IOException {
   try {
     if (TlsUtils.isTLSv12(context)) {
       return signer.generateRawSignature(signatureAndHashAlgorithm, privateKey, hash);
     } else {
       return signer.generateRawSignature(privateKey, hash);
     }
   } catch (CryptoException e) {
     throw new TlsFatalAlert(AlertDescription.internal_error, e);
   }
 }