Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 67906a73
authored
Apr 06, 2012
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
certificate
1 parent
6fb0d9b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Certificate.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Certificate.java
0 → 100644
View file @
67906a7
package
fi
.
insomnia
.
bortal
.
model
;
import
java.io.IOException
;
import
java.io.Serializable
;
import
java.io.StringReader
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
org.bouncycastle.openssl.PEMReader
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: Certificate
*
*/
@Entity
@Table
(
name
=
"certificate"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
Certificate
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"common_name"
)
private
String
commonName
;
private
String
certificate
;
public
Certificate
()
{
super
();
}
public
String
getCommonName
()
{
return
this
.
commonName
;
}
public
void
setCommonName
(
String
commonName
)
{
this
.
commonName
=
commonName
;
}
public
String
getCertificate
()
{
return
this
.
certificate
;
}
public
X509Certificate
getX509Certificate
()
throws
CertificateException
,
IOException
{
StringReader
sr
=
new
StringReader
(
this
.
certificate
);
PEMReader
pemReader
=
new
PEMReader
(
sr
);
X509Certificate
cert
=
(
X509Certificate
)
pemReader
.
readObject
();
return
cert
;
}
public
void
setCertificate
(
String
certificate
)
{
this
.
certificate
=
certificate
;
}
public
void
set509Certificate
(
X509Certificate
cert
)
{
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment