it.sistematica.isharedoc.service.keyring
Class CertificateServiceImpl

java.lang.Object
  extended by it.sistematica.isharedoc.service.keyring.CertificateServiceImpl
All Implemented Interfaces:
CertificateService

@Service(value="certificateService")
public class CertificateServiceImpl
extends java.lang.Object
implements CertificateService


Field Summary
(package private)  CloudManager cloudManager
           
(package private)  it.neverworks.util.Configuration configuration
           
(package private)  it.neverworks.data.EntityManager entities
           
(package private)  PartitionService partitionService
           
(package private)  org.hibernate.SessionFactory sessionFactory
           
(package private)  it.neverworks.application.service.UserInfo userInfo
           
 
Fields inherited from interface it.sistematica.isharedoc.service.keyring.CertificateService
CA_CERT_SERIAL
 
Constructor Summary
CertificateServiceImpl()
           
 
Method Summary
 java.io.InputStream generateCACRL()
          Generate cacrl.
 void generateCAKeyStoreAndCertificate()
          Generate ca key store and certificate.
 Certificate generateUserCertificate(it.neverworks.security.User user, java.security.PublicKey userPublicKey, org.bouncycastle.asn1.x509.KeyUsage keyUsage)
          Generate user certificate.
 java.security.KeyStore getIsharedocCAKeyStore()
          Gets the isharedoc ca key store.
 java.security.PrivateKey getIsharedocCAPrivateKey(java.security.KeyStore rootKeyStore)
          Gets the isharedoc ca private key.
 Certificate getIsharedocCAX509Certificate()
          Gets the isharedoc ca x509 certificate.
 java.security.cert.X509Certificate getIsharedocCAX509Certificate(java.security.KeyStore rootKeyStore)
          Gets the isharedoc ca x509 certificate.
 org.bouncycastle.asn1.x509.X509Name getIsharedocCAX509Name()
          Gets the isharedoc ca x509 name.
 org.bouncycastle.asn1.x509.X509Name getUserX509Name(it.neverworks.security.User user)
          Gets the user x509 name.
 void revokeUserCertificate(Certificate userCert, int reason)
          Revoke user certificate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userInfo

it.neverworks.application.service.UserInfo userInfo

entities

it.neverworks.data.EntityManager entities

configuration

it.neverworks.util.Configuration configuration

partitionService

PartitionService partitionService

sessionFactory

org.hibernate.SessionFactory sessionFactory

cloudManager

CloudManager cloudManager
Constructor Detail

CertificateServiceImpl

public CertificateServiceImpl()
Method Detail

getIsharedocCAX509Name

public org.bouncycastle.asn1.x509.X509Name getIsharedocCAX509Name()
Description copied from interface: CertificateService
Gets the isharedoc ca x509 name.

Specified by:
getIsharedocCAX509Name in interface CertificateService
Returns:
the isharedoc ca x509 name

getIsharedocCAKeyStore

@Secured(value="ROLE_ADMINISTRATOR")
public java.security.KeyStore getIsharedocCAKeyStore()
Description copied from interface: CertificateService
Gets the isharedoc ca key store.

Specified by:
getIsharedocCAKeyStore in interface CertificateService
Returns:
the isharedoc ca key store

getIsharedocCAX509Certificate

@Secured(value="ROLE_ADMINISTRATOR")
public java.security.cert.X509Certificate getIsharedocCAX509Certificate(java.security.KeyStore rootKeyStore)
Description copied from interface: CertificateService
Gets the isharedoc ca x509 certificate.

Specified by:
getIsharedocCAX509Certificate in interface CertificateService
Parameters:
rootKeyStore - the root key store
Returns:
the isharedoc ca x509 certificate

getIsharedocCAPrivateKey

@Secured(value="ROLE_ADMINISTRATOR")
public java.security.PrivateKey getIsharedocCAPrivateKey(java.security.KeyStore rootKeyStore)
Description copied from interface: CertificateService
Gets the isharedoc ca private key.

Specified by:
getIsharedocCAPrivateKey in interface CertificateService
Parameters:
rootKeyStore - the root key store
Returns:
the isharedoc ca private key

getUserX509Name

public org.bouncycastle.asn1.x509.X509Name getUserX509Name(it.neverworks.security.User user)
Description copied from interface: CertificateService
Gets the user x509 name.

Specified by:
getUserX509Name in interface CertificateService
Parameters:
user - the user
Returns:
the user x509 name

generateCAKeyStoreAndCertificate

@Transactional
@Secured(value="ROLE_ADMINISTRATOR")
public void generateCAKeyStoreAndCertificate()
Description copied from interface: CertificateService
Generate ca key store and certificate.

Specified by:
generateCAKeyStoreAndCertificate in interface CertificateService

generateUserCertificate

public Certificate generateUserCertificate(it.neverworks.security.User user,
                                           java.security.PublicKey userPublicKey,
                                           org.bouncycastle.asn1.x509.KeyUsage keyUsage)
Description copied from interface: CertificateService
Generate user certificate.

Specified by:
generateUserCertificate in interface CertificateService
Parameters:
user - the user
userPublicKey - the user public key
keyUsage - the key usage
Returns:
the certificate

revokeUserCertificate

public void revokeUserCertificate(Certificate userCert,
                                  int reason)
Description copied from interface: CertificateService
Revoke user certificate.

Specified by:
revokeUserCertificate in interface CertificateService
Parameters:
userCert - the user cert
reason - the reason

generateCACRL

@Transactional
public java.io.InputStream generateCACRL()
Description copied from interface: CertificateService
Generate cacrl.

Specified by:
generateCACRL in interface CertificateService
Returns:
the input stream

getIsharedocCAX509Certificate

public Certificate getIsharedocCAX509Certificate()
Description copied from interface: CertificateService
Gets the isharedoc ca x509 certificate.

Specified by:
getIsharedocCAX509Certificate in interface CertificateService
Returns:
the isharedoc ca x509 certificate