| | |
| | | * |
| | | * Copyright 2013-2014 Manuel Gaupp |
| | | * Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.asn1; |
| | | |
| | |
| | | import java.math.BigInteger; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import org.opends.messages.Message; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | import static org.forgerock.util.Reject.*; |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | Message msg = ERR_GSER_PATTERN_NO_MATCH.get(pattern.pattern(), |
| | | LocalizableMessage msg = ERR_GSER_PATTERN_NO_MATCH.get(pattern.pattern(), |
| | | gserValue.substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | Message msg = ERR_GSER_PATTERN_NO_MATCH.get(pattern.pattern(), |
| | | LocalizableMessage msg = ERR_GSER_PATTERN_NO_MATCH.get(pattern.pattern(), |
| | | gserValue.substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | |
| | | { |
| | | if (!hasNext(GSER_SEP)) |
| | | { |
| | | Message msg = ERR_GSER_NO_VALID_SEPARATOR.get(gserValue |
| | | LocalizableMessage msg = ERR_GSER_NO_VALID_SEPARATOR.get(gserValue |
| | | .substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | |
| | | { |
| | | if (!hasNext(GSER_STRING)) |
| | | { |
| | | Message msg = ERR_GSER_NO_VALID_STRING.get(gserValue |
| | | LocalizableMessage msg = ERR_GSER_NO_VALID_STRING.get(gserValue |
| | | .substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | |
| | | { |
| | | if (!hasNext(GSER_INTEGER)) |
| | | { |
| | | Message msg = ERR_GSER_NO_VALID_INTEGER.get(gserValue |
| | | LocalizableMessage msg = ERR_GSER_NO_VALID_INTEGER.get(gserValue |
| | | .substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | |
| | | { |
| | | if (!hasNext(GSER_INTEGER)) |
| | | { |
| | | Message msg = ERR_GSER_NO_VALID_INTEGER.get(gserValue |
| | | LocalizableMessage msg = ERR_GSER_NO_VALID_INTEGER.get(gserValue |
| | | .substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | |
| | | { |
| | | if (!hasNext(GSER_IDENTIFIER)) |
| | | { |
| | | Message msg = ERR_GSER_NO_VALID_IDENTIFIER.get(gserValue |
| | | LocalizableMessage msg = ERR_GSER_NO_VALID_IDENTIFIER.get(gserValue |
| | | .substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | | String identifier = next(GSER_IDENTIFIER); |
| | | if (!hasNext(GSER_MSP)) |
| | | { |
| | | Message msg = ERR_GSER_SPACE_CHAR_EXPECTED.get(gserValue |
| | | LocalizableMessage msg = ERR_GSER_SPACE_CHAR_EXPECTED.get(gserValue |
| | | .substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |
| | |
| | | { |
| | | if (!hasNext(GSER_CHOICE_IDENTIFIER)) |
| | | { |
| | | Message msg = ERR_GSER_NO_VALID_IDENTIFIEDCHOICE.get(gserValue |
| | | LocalizableMessage msg = ERR_GSER_NO_VALID_IDENTIFIEDCHOICE.get(gserValue |
| | | .substring(pos,length)); |
| | | throw new GSERException(msg); |
| | | } |